Skip to content

Commit 8739c13

Browse files
committed
fix(release): configure release-please permissions and token
1 parent 6884bd3 commit 8739c13

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

.github/workflows/release.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,36 @@
1+
# This workflow automates the process of creating releases, updating the CHANGELOG,
2+
# and publishing the package to npm using release-please.
3+
14
name: Release
25

36
on:
47
push:
8+
# Trigger on push to the primary branch (usually 'main' or 'master')
59
branches:
610
- main
11+
workflow_dispatch:
712

813
jobs:
914
release-please:
1015
runs-on: ubuntu-latest
16+
permissions:
17+
# Required for creating releases and pushing changes to the repository
18+
contents: write
19+
# Required for managing pull requests (Crucial for creating the release PR)
20+
pull-requests: write
21+
1122
steps:
12-
- uses: actions/checkout@v4
13-
- name: Install dependencies
14-
run: npm install
15-
- uses: google-github-actions/release-please@v4
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
# 1. Run the release-please action
27+
# Using the recommended 'googleapis/release-please-action'
28+
- name: Run Release Please
29+
uses: googleapis/release-please-action@v4
1630
id: release
1731
with:
1832
release-type: node
19-
package-name: repo-description
33+
target-branch: main
34+
# Passing the GITHUB_TOKEN via the 'token' input for maximum reliability
35+
# in creating Pull Requests (resolves the permission error).
36+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)