Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Oct 27, 2021
1 parent f04bd97 commit 3ded89e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Expand Up @@ -280,8 +280,7 @@ jobs:
- name: Deploy to `npm` branch
run: npm run gitpublish:npm
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_ACTOR: ${{ env.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

deploy-to-deno-branch:
name: Deploy to `deno` branch
Expand Down Expand Up @@ -317,5 +316,4 @@ jobs:
- name: Deploy to `deno` branch
run: npm run gitpublish:deno
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_ACTOR: ${{ env.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 5 additions & 7 deletions resources/gitpublish.sh
Expand Up @@ -23,15 +23,13 @@ if [ -z "${DIST_DIR}" ]; then
exit 1;
fi;

if [ -z "${GH_TOKEN}" ]; then
echo 'Must provide GH_TOKEN as environment variable!'
if [ -z "${GITHUB_TOKEN}" ]; then
echo 'Must provide GITHUB_TOKEN as environment variable!'
exit 1;
fi;

if [ -z "${GH_ACTOR}" ]; then
GITHUB_CREDENTIALS="${GH_TOKEN}";
else
GITHUB_CREDENTIALS="${GH_ACTOR}:${GH_TOKEN}";
if [ -z "${GITHUB_ACTOR}" ]; then
echo 'Must provide GITHUB_ACTOR as environment variable!'
fi;

if [ ! -d $DIST_DIR ]; then
Expand All @@ -41,7 +39,7 @@ fi;

# Create empty directory
rm -rf $BRANCH
git clone -b $BRANCH -- "https://${GITHUB_CREDENTIALS}@github.com/graphql/graphql-js.git" $BRANCH
git clone -b $BRANCH -- "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/graphql/graphql-js.git" $BRANCH

# Remove existing files first
rm -rf $BRANCH/**/*
Expand Down

0 comments on commit 3ded89e

Please sign in to comment.