Skip to content

Commit 895d10b

Browse files
committed
Moved secrets to env vars to avoid expansion in run blocks
1 parent 095a43f commit 895d10b

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.github/workflows/sync-changes-to-gitlab.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
fetch-depth: 0
2323

2424
- name: Push changes to gitlab.com/adamlui/python-utils
25+
env:
26+
GITLAB_SYNC_PAT: ${{ secrets.GITLAB_SYNC_PAT }}
2527
run: |
2628
git push --force -o ci.skip \
27-
https://oauth2:${{ secrets.GITLAB_SYNC_PAT }}@gitlab.com/adamlui/python-utils.git main
29+
https://oauth2:[email protected]/adamlui/python-utils.git main

.github/workflows/sync-translate-en-messages.py-changes-to-repos.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,19 @@ jobs:
7171
echo "EOF" >> $GITHUB_ENV
7272
7373
- name: Config committer
74+
env:
75+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
76+
GPG_PRIVATE_ID: ${{ secrets.GPG_PRIVATE_ID }}
7477
run: |
75-
gpg --batch --import <(echo "${{ secrets.GPG_PRIVATE_KEY }}")
78+
gpg --batch --import <(echo "$GPG_PRIVATE_KEY")
7679
git config --global commit.gpgsign true
7780
git config --global user.name "kudo-sync-bot"
7881
git config --global user.email "[email protected]"
79-
git config --global user.signingkey "${{ secrets.GPG_PRIVATE_ID }}"
82+
git config --global user.signingkey "$GPG_PRIVATE_ID"
8083
8184
- name: Replace outdated files in target repos, push changes
85+
env:
86+
REPO_SYNC_PAT: ${{ secrets.REPO_SYNC_PAT }}
8287
run: |
8388
TARGET_REPOS=(${{ steps.list_repos.outputs.REPOS }})
8489
source_file="${{ github.workspace }}/adamlui/python-utils/translate-messages/translate-en-messages.py"
@@ -99,7 +104,7 @@ jobs:
99104
done
100105
git diff-index --quiet HEAD || (echo "Committing changes" && \
101106
git commit -m "$ESCAPED_MSG ↞ [auto-sync from https://github.com/adamlui/python-utils/tree/main/translate-messages]")
102-
git remote set-url --push origin "https://kudo-sync-bot:${{ secrets.REPO_SYNC_PAT }}@github.com/$repo"
107+
git remote set-url --push origin "https://kudo-sync-bot:[email protected]/$repo"
103108
echo "Pushing changes"
104109
git push --force
105110
echo "::endgroup::"

0 commit comments

Comments
 (0)