diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index 28655121..ad69e758 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -7,6 +7,10 @@ on: default: 18 required: false type: string + secrets: + GITHUB_USER_TOKEN: + description: Authentication token with write permission needed by the release bot (falls back to GITHUB_TOKEN). + required: false jobs: release: @@ -31,6 +35,8 @@ jobs: - name: Checkout uses: actions/checkout@v4 + with: + persist-credentials: false - name: Check presence of release.config.js run: | @@ -57,5 +63,5 @@ jobs: - name: Release env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_USER_TOKEN != '' && secrets.GITHUB_USER_TOKEN || secrets.GITHUB_TOKEN }} run: npx semantic-release diff --git a/docs/automatic-release.md b/docs/automatic-release.md index 91925525..6c2ce7c8 100644 --- a/docs/automatic-release.md +++ b/docs/automatic-release.md @@ -44,9 +44,10 @@ jobs: #### Inputs -| Name | Default | Description | -|----------------|---------|------------------------------------------------------| -| `NODE_VERSION` | 18 | Node version with which the release will be executed | +| Name | Required | Default | Description | +|---------------------|----------|---------|---------------------------------------------------------------------------------------------------| +| `NODE_VERSION` | false |18 | Node version with which the release will be executed | +| `GITHUB_USER_TOKEN` | false |`''` | Authentication token with write permission needed by the release bot (falls back to GITHUB_TOKEN) | **Example with configuration parameters:** @@ -62,4 +63,6 @@ jobs: uses: inpsyde/reusable-workflows/.github/workflows/automatic-release.yml@main with: NODE_VERSION: 16 + secrets: + GITHUB_USER_TOKEN: ${{ secrets.WRITE_TOKEN }} ```