Skip to content

Commit a0646b0

Browse files
committed
ci: Use password.
1 parent 3661dc4 commit a0646b0

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

.github/workflows/publish.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,16 @@ jobs:
5858
echo SHA: $OLD_SHA1 -> $NEW_SHA1
5959
echo Publishing dummy...
6060
npm publish
61-
echo Setting up SSH keys...
62-
sudo apt-get install dos2unix
63-
mkdir -p ~/.ssh
64-
chmod 700 ~/.ssh
65-
echo $REGISTRY_SSH_KEY > ~/.ssh/id_rsa
66-
echo $REGISTRY_SSH_PUBKEY > ~/.ssh/id_rsa.pub
67-
chmod 600 ~/.ssh/id_rsa
68-
dos2unix ~/.ssh/id_rsa
6961
echo Getting package.json to patch...
70-
scp -v -o StrictHostKeyChecking=no [email protected]:$REGISTRY_SSH_PATH/package.json package-registry.json
62+
sudo apt-get install sshpass
63+
sshpass -p '$REGISTRY_SSH_PASSWORD' scp -v -o StrictHostKeyChecking=no [email protected]:$REGISTRY_SSH_PATH/package.json package-registry.json
7164
cat package-registry.json
7265
sed -i 's/$OLD_SHA1/$NEW_SHA1/' package-registry.json
7366
cat package-registry.json
74-
scp -o StrictHostKeyChecking=no $NPM_ARCHIVE [email protected]:$REGISTRY_SSH_PATH
75-
scp -o StrictHostKeyChecking=no package-registry.json [email protected]:$REGISTRY_SSH_PATH/package.json
76-
rm ~/.ssh/id_rsa ~/.ssh/id_rsa.pub
67+
sshpass -p '$REGISTRY_SSH_PASSWORD' scp -o StrictHostKeyChecking=no $NPM_ARCHIVE [email protected]:$REGISTRY_SSH_PATH
68+
sshpass -p '$REGISTRY_SSH_PASSWORD' scp -o StrictHostKeyChecking=no package-registry.json [email protected]:$REGISTRY_SSH_PATH/package.json
7769
env:
7870
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
79-
REGISTRY_SSH_KEY: ${{ secrets.REGISTRY_SSH_KEY }}
80-
REGISTRY_SSH_PUBKEY: ${{ secrets.REGISTRY_SSH_PUBKEY }}
71+
REGISTRY_SSH_PASSWORD: ${{ secrets.REGISTRY_SSH_PASSWORD }}
8172
REGISTRY_SSH_USERNAME: ${{ secrets.REGISTRY_SSH_USERNAME }}
8273
REGISTRY_SSH_PATH: ${{ secrets.REGISTRY_SSH_PATH }}

0 commit comments

Comments
 (0)