Skip to content

Commit aefa30f

Browse files
committedFeb 27, 2025··
👷 Push from GitHub Workflows with a deploy key
1 parent 07faee0 commit aefa30f

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed
 

‎.github/workflows/node.js.yaml

+9-2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ jobs:
7070
- uses: actions/checkout@v4
7171
with:
7272
ref: ${{ github.ref }}
73+
ssh-key: ${{ secrets.DEPLOY_KEY_PRIVATE }}
7374
- uses: pnpm/action-setup@v4
7475
with:
7576
version: latest
@@ -114,5 +115,11 @@ jobs:
114115
[dependabot skip]
115116
skip-empty: true
116117

117-
- if: steps.commit-lockfile.outputs.commit || steps.commit-format.outputs.commit || steps.commit-lint.outputs.commit
118-
run: git push
118+
- name: Push
119+
if: steps.commit-lockfile.outputs.commit || steps.commit-format.outputs.commit || steps.commit-lint.outputs.commit
120+
run: |
121+
eval `ssh-agent -s`
122+
ssh-add - <<< "$DEPLOY_KEY_PRIVATE"
123+
git push
124+
env:
125+
DEPLOY_KEY_PRIVATE: ${{ secrets.DEPLOY_KEY_PRIVATE }}

‎.github/workflows/pnpm-version-patch.yaml

+9-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
- uses: actions/checkout@v4
1616
with:
1717
ref: ${{ github.ref }}
18+
ssh-key: ${{ secrets.DEPLOY_KEY_PRIVATE }}
1819
- uses: pnpm/action-setup@v4
1920
with:
2021
version: latest
@@ -29,9 +30,15 @@ jobs:
2930
with:
3031
message: 🔖 ${{ steps.patch.outputs.VERSION }}
3132

32-
- run: |
33+
- name: Push
34+
run: |
35+
eval `ssh-agent -s`
36+
ssh-add - <<< "$DEPLOY_KEY_PRIVATE"
3337
git push
34-
gh release create "$VERSION" --generate-notes --target "$COMMIT" --title "$VERSION"
38+
env:
39+
DEPLOY_KEY_PRIVATE: ${{ secrets.DEPLOY_KEY_PRIVATE }}
40+
41+
- run: gh release create "$VERSION" --generate-notes --target "$COMMIT" --title "$VERSION"
3542
env:
3643
COMMIT: ${{ steps.commit.outputs.commit }}
3744
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)
Please sign in to comment.