Skip to content

Commit 9019bb4

Browse files
committed
Fix action token
1 parent aa58003 commit 9019bb4

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
uses: fastapi-practices/plugin-release@v1
2626
with:
2727
push-to: your-username/plugins
28+
env:
29+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
2830
```
2931
3032
## Inputs
@@ -34,6 +36,12 @@ jobs:
3436
| `push-to` | Yes | — | The repository to push the update branch to (`owner/repo`), e.g. `your-username/plugins` |
3537
| `plugin-name` | No | Repository name of the caller | Plugin name, must match the submodule directory name in `fastapi-practices/plugins` |
3638

39+
## Environment variables
40+
41+
| Variable | Required | Description |
42+
| ---------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------- |
43+
| `GH_TOKEN` | Yes | GitHub personal access token with write access to the push-to repository, see [creating a PAT](https://github.com/settings/tokens) |
44+
3745
## How it works
3846

3947
1. Validates that the version in `plugin.toml` matches the pushed tag

action.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ runs:
5252
uses: actions/checkout@v4
5353
with:
5454
repository: ${{ inputs.push-to }}
55-
token: ${{ github.token }}
55+
token: ${{ env.GH_TOKEN }}
5656
submodules: true
5757
fetch-depth: 0
5858

@@ -164,5 +164,3 @@ runs:
164164
PR_NUMBER=$(echo "${PR_URL}" | grep -oE '[0-9]+$')
165165
echo "pr-number=${PR_NUMBER}" >> "$GITHUB_OUTPUT"
166166
echo "::notice::Pull request created: ${PR_URL}"
167-
env:
168-
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)