Skip to content

Commit 501dd27

Browse files
k0kubunnobu
andcommitted
post_push.yml: Write the SSH key more securely
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
1 parent 77b019f commit 501dd27

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

.github/workflows/post_push.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ jobs:
1313
- name: Sync git.ruby-lang.org
1414
run: |
1515
mkdir -p ~/.ssh
16-
echo "$RUBY_GIT_SYNC_PRIVATE_KEY" > ~/.ssh/id_ed25519
17-
chmod 600 ~/.ssh/id_ed25519
16+
(umask 066; printenv RUBY_GIT_SYNC_PRIVATE_KEY > ~/.ssh/id_ed25519)
1817
ssh-keyscan -t ed25519 git.ruby-lang.org >> ~/.ssh/known_hosts
1918
ssh -i ~/.ssh/id_ed25519 git-sync@git.ruby-lang.org "sudo -u git /home/git/git.ruby-lang.org/bin/update-ruby.sh $GITHUB_REF"
2019
env:

0 commit comments

Comments
 (0)