Skip to content

Commit

Permalink
fix(ci): allows semantic-release to push changes
Browse files Browse the repository at this point in the history
During the release generation in the ci job, semantic-release needs to
push the new content of the package.json, package-lock.json, and
CHANGELOG.md files, since the next and current branches are protected,
it needs to use a Github App to proceed with the push
  • Loading branch information
jeysonj2 committed May 26, 2023
1 parent 0fb1c71 commit acccb19
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/nodejs.release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@ on:

jobs:
build-and-publish:
permissions:
contents: write
issues: write
pull-requests: write

runs-on: ubuntu-latest
concurrency: release

steps:
- name: Generate GitHub token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.SEMANTIC_RELEASE_APP_ID }}
private_key: ${{ secrets.SEMANTIC_RELEASE_PRIVATE_KEY }}

- uses: actions/checkout@v3
with:
token: ${{ steps.generate_token.outputs.token }}

- name: Set up Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -34,4 +40,4 @@ jobs:
run: npm run semantic-release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}

0 comments on commit acccb19

Please sign in to comment.