Skip to content

Commit 3cb0796

Browse files
authored
ci: fix publishment commit push (#658)
1 parent 3dd54eb commit 3cb0796

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

.github/actions/setup/action.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@ inputs:
44
node-version:
55
description: 'The Node.js version to use. The default one is going to be the defined on the .nvmrc file.'
66
required: false
7+
git_bot_token:
8+
description: Git Bot token used to push to protected branches because github token can't
9+
required: false
10+
711
runs:
812
using: composite
913
steps:
1014
- name: Checkout all commits
1115
uses: actions/checkout@v4
1216
with:
17+
token: ${{ inputs.git_bot_token || github.token }}
1318
fetch-depth: 0
1419

20+
- name: git config
21+
shell: bash
22+
run: |
23+
git config user.name "ngx-deploy-npm Bot"
24+
git config user.email "-"
25+
1526
- name: Set Node.js version based on .nvmrc or Action Input
1627
shell: bash
1728
run: |

.github/workflows/publishment.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,12 @@ jobs:
4646
release:
4747
environment: production
4848
runs-on: ubuntu-latest
49-
permissions:
50-
contents: write
5149
needs: [release-preliminar, e2e-test, test, backwards-compatibility-test]
5250
steps:
5351
- uses: actions/checkout@v4
5452
- uses: ./.github/actions/setup
55-
56-
- name: git config
57-
shell: bash
58-
run: |
59-
git config user.name "Github Actions"
60-
git config user.email "-"
53+
with:
54+
git_bot_token: ${{ secrets.GIT_BOT_TOKEN }}
6155

6256
- uses: ./.github/actions/download-build
6357

@@ -80,7 +74,7 @@ jobs:
8074
- name: Push changes
8175
uses: ad-m/github-push-action@master
8276
with:
83-
github_token: ${{ secrets.GITHUB_TOKEN }}
77+
github_token: ${{ secrets.GIT_BOT_TOKEN }}
8478
branch: ${{ github.ref }}
8579
force: true
8680
tags: true

0 commit comments

Comments
 (0)