Skip to content

Commit

Permalink
GA: 令牌以环境变量的方式传递
Browse files Browse the repository at this point in the history
  • Loading branch information
maboloshi committed Feb 23, 2024
1 parent 676671f commit 991e18c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/locals(greasyfork).js_update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
if: ${{ env.LOCALS_JS_IS_CHANGED == 'true' &&
env.MAIN_USER_JS_IS_CHANGED == 'true' }}
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
APP_SLUG: ${{ steps.generate_token.outputs.app-slug }}
run: |
bash script/ci_commit_with_signature.sh \
-T "${{ steps.generate_token.outputs.token }}" \
-R "${{ github.repository }}" \
-B "${{ github.ref_name }}" \
-P "${{ github.sha }}" \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.user.js_version_update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ jobs:
if: ${{ env.LOCALS_JS_IS_CHANGED == 'true' &&
env.MAIN_USER_JS_IS_CHANGED == 'true' }}
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
APP_SLUG: ${{ steps.generate_token.outputs.app-slug }}
run: |
bash script/ci_commit_with_signature.sh \
-T "${{ steps.generate_token.outputs.token }}" \
-R "${{ github.repository }}" \
-B "${{ github.ref_name }}" \
-P "${{ github.sha }}" \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_contributors_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:
- name: Commit and push README.md
if: ${{ env.CHANGES_DETECTED == 'true' }}
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
APP_SLUG: ${{ steps.generate_token.outputs.app-slug }}
run: |
bash script/ci_commit_with_signature.sh \
-T "${{ steps.generate_token.outputs.token }}" \
-R "${{ github.repository }}" \
-B "${{ github.ref_name }}" \
-P "${{ github.sha }}" \
Expand Down
4 changes: 4 additions & 0 deletions script/ci_commit_with_signature.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ while getopts ":T:R:B:P:F:D:h:b:" opt; do
esac
done

if [[ -z $TOKEN ]]; then
TOKEN=$GITHUB_TOKEN
fi

if [[ -z $GITHUB_URL ]]; then
GITHUB_URL="https://api.github.com"
fi
Expand Down

0 comments on commit 991e18c

Please sign in to comment.