Skip to content

Commit 0e364bd

Browse files
committed
update-project-version: Add token input
1 parent 2c946e7 commit 0e364bd

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
- [`branch-prefix`](#branch-prefix)
3030
- [`create-pull-request`](#create-pull-request)
3131
- [`version-rule` and `use-dev-suffix`](#version-rule-and-use-dev-suffix)
32+
- [`token`](#token)
3233

3334
## `ni/python-actions/setup-python`
3435

@@ -252,3 +253,13 @@ The defaults are `version-rule=patch` and `use-dev-suffix=true`, which have the
252253

253254
When you are ready to exit the "dev" phase, you should manually update the version number to the
254255
desired release version before creating a release in GitHub.
256+
257+
#### `token`
258+
259+
The default GITHUB_TOKEN cannot trigger PR workflows. You can work around this by using `token` to
260+
specify a token that is saved in a repo/org secret.
261+
262+
See [Triggering further workflow
263+
runs](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs)
264+
in the `create-pull-request` action documentation for more info about this problem and other
265+
solutions to it.

update-project-version/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ inputs:
1212
Specifies whether to create a pull request. Set this to false to update
1313
the project version without creating a pull request.
1414
default: true
15+
token:
16+
description: >
17+
GitHub token to use to create the pull request. The default GITHUB_TOKEN
18+
cannot trigger PR workflows, so you can use this to specify a PAT that is
19+
saved in a repo/org secret.
20+
default: ${{ github.token }}
1521
version-rule:
1622
description: >
1723
Specifies the rule for how to update the version number, such as "major",
@@ -58,6 +64,7 @@ runs:
5864
branch: ${{ steps.set-vars.outputs.branch-name }}
5965
commit-message: "chore: Update project version - ${{ steps.set-vars.outputs.base-branch }}"
6066
title: "chore: Update project version - ${{ steps.set-vars.outputs.base-branch }}"
67+
token: ${{ inputs.token }}
6168
# The workflow log currently points to the run, not the specific job
6269
# within that run. Linking to a specific job requires the numeric job id,
6370
# which is not available in the github context.

0 commit comments

Comments
 (0)