diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 0754b2a7..7b4dd30a 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -4,14 +4,25 @@ inputs: node-version: description: 'The Node.js version to use. The default one is going to be the defined on the .nvmrc file.' required: false + git_bot_token: + description: Git Bot token used to push to protected branches because github token can't + required: false + runs: using: composite steps: - name: Checkout all commits uses: actions/checkout@v4 with: + token: ${{ inputs.git_bot_token || github.token }} fetch-depth: 0 + - name: git config + shell: bash + run: | + git config user.name "ngx-deploy-npm Bot" + git config user.email "-" + - name: Set Node.js version based on .nvmrc or Action Input shell: bash run: | diff --git a/.github/workflows/publishment.yml b/.github/workflows/publishment.yml index b83feca0..e9fb0a1a 100644 --- a/.github/workflows/publishment.yml +++ b/.github/workflows/publishment.yml @@ -46,18 +46,12 @@ jobs: release: environment: production runs-on: ubuntu-latest - permissions: - contents: write needs: [release-preliminar, e2e-test, test, backwards-compatibility-test] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup - - - name: git config - shell: bash - run: | - git config user.name "Github Actions" - git config user.email "-" + with: + git_bot_token: ${{ secrets.GIT_BOT_TOKEN }} - uses: ./.github/actions/download-build @@ -80,7 +74,7 @@ jobs: - name: Push changes uses: ad-m/github-push-action@master with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.GIT_BOT_TOKEN }} branch: ${{ github.ref }} force: true tags: true