-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: clasp credentials saving to GITHUB_ENV
- Loading branch information
Showing
1 changed file
with
6 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,15 +29,12 @@ jobs: | |
- name: Save current .clasp.json contents to CLASPRC_JSON_FILE environment variable | ||
id: save-clasprc | ||
run: | | ||
echo ::add-mask::$(tr -d '\n\r' < ~/.clasp.json) | ||
echo "CLASPRC_JSON_FILE=$(tr -d '\n\r' < ~/.clasp.json)" >> $GITHUB_ENV | ||
echo ::add-mask::$(cat ~/.clasp.json | jq -c) | ||
echo "CLASPRC_JSON_FILE=$(cat ~/.clasp.json | jq -c)" >> $GITHUB_ENV | ||
- name: Save CLASPRC_JSON_FILE environment variable to CLASPRC_JSON repo secret | ||
id: set-clasprc-secret | ||
if: ${{ env.CLASPRC_JSON_FILE != env.CLASPRC_JSON_SECRET }} | ||
uses: hmanzur/[email protected] | ||
env: | ||
CLASPRC_JSON_SECRET: ${{ secrets.CLASPRC_JSON }} | ||
with: | ||
name: "CLASPRC_JSON" | ||
value: ${{ env.CLASPRC_JSON_FILE }} | ||
|
@@ -46,15 +43,13 @@ jobs: | |
|
||
- name: Checkout repo | ||
id: checkout-repo | ||
if: ${{github.event_name != 'schedule' }} | ||
uses: actions/checkout@v2 | ||
if: ${{github.event_name != 'schedule' }} | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set scriptId in .clasp.json file | ||
id: set-script-id | ||
if: ${{ github.event_name != 'schedule' && env.SCRIPT_ID}} | ||
run: jq '.scriptId = "${{env.SCRIPT_ID}}"' .clasp.json > /tmp/.clasp.json && mv /tmp/.clasp.json .clasp.json | ||
env: | ||
SCRIPT_ID: ${{secrets.SCRIPT_ID}} | ||
if: ${{ github.event_name != 'schedule' && secrets.SCRIPT_ID }} | ||
run: jq '.scriptId = "${{secrets.SCRIPT_ID}}"' .clasp.json > /tmp/.clasp.json && mv /tmp/.clasp.json .clasp.json | ||
|
||
- name: Push script to scripts.google.com | ||
id: clasp-push | ||
|