Skip to content

Commit f04bd97

Browse files
committed
Use default GITHUB_ACTOR if unset
1 parent dc1f7a5 commit f04bd97

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ jobs:
281281
run: npm run gitpublish:npm
282282
env:
283283
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
284+
GH_ACTOR: ${{ env.GITHUB_ACTOR }}
284285

285286
deploy-to-deno-branch:
286287
name: Deploy to `deno` branch
@@ -317,3 +318,4 @@ jobs:
317318
run: npm run gitpublish:deno
318319
env:
319320
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
321+
GH_ACTOR: ${{ env.GITHUB_ACTOR }}

resources/gitpublish.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,20 @@ if [ -z "${GH_TOKEN}" ]; then
2828
exit 1;
2929
fi;
3030

31+
if [ -z "${GH_ACTOR}" ]; then
32+
GITHUB_CREDENTIALS="${GH_TOKEN}";
33+
else
34+
GITHUB_CREDENTIALS="${GH_ACTOR}:${GH_TOKEN}";
35+
fi;
36+
3137
if [ ! -d $DIST_DIR ]; then
3238
echo "Directory '${DIST_DIR}' does not exist!"
3339
exit 1;
3440
fi;
3541

3642
# Create empty directory
3743
rm -rf $BRANCH
38-
git clone -b $BRANCH -- "https://${GITHUB_ACTOR}:${GH_TOKEN}@github.com/graphql/graphql-js.git" $BRANCH
44+
git clone -b $BRANCH -- "https://${GITHUB_CREDENTIALS}@github.com/graphql/graphql-js.git" $BRANCH
3945

4046
# Remove existing files first
4147
rm -rf $BRANCH/**/*

0 commit comments

Comments
 (0)