Skip to content

Commit f732705

Browse files
authored
update-project-version: Add token input (#9)
* update-project-version: Add `token` input * update-project-version: Clarify docs about PR status checks
1 parent 2c946e7 commit f732705

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

README.md

Lines changed: 12 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,14 @@ 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, so the generated pull request will not run any
260+
status checks. You can work around this by using `token` to specify a token that is saved in a
261+
repo/org secret.
262+
263+
See [Triggering further workflow
264+
runs](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs)
265+
in the `create-pull-request` action documentation for more info about this problem and other
266+
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 (i.e., it will not run PR status checks). You
19+
can use this input to specify a PAT that is 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)