mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
Use GitHub API for pushes by default and require explicit github-token when using custom tokens (#692)
* Ensure `github-token` wins for `git-cli` pushes * more shenanigans * Default to GitHub API commit mode * e2e auth tests * push missing utils * rename input * refactor * refactor * refactor * refactor * refactor * refactor * reuse helpers * refactor * refactor * simplify * add tests * refactor * improve comments * shift helper * add comments * extract test helpers * update docs and changesets * update one thing
This commit is contained in:
+9
-9
@@ -22,15 +22,15 @@ This action versions packages and creates or updates a pull request with the cha
|
||||
|
||||
<!-- api-start -->
|
||||
|
||||
| Inputs | Description |
|
||||
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `github-token` | The GitHub token to use for authentication. Defaults to the GitHub-provided token. |
|
||||
| `script` | The command to use to version packages |
|
||||
| `commit-message` | The commit message. Default to `Version Packages` |
|
||||
| `pr-title` | The pull request title. Default to `Version Packages` |
|
||||
| `pr-draft` | Controls draft PR behavior. Use 'create' to create new version PRs as draft, or 'always' to also convert existing version PRs back to draft when updating them. |
|
||||
| `pr-base-branch` | Sets the base branch of the PR. Defaults to `github.ref_name`. |
|
||||
| `commit-mode` | An enum to specify the commit mode. Use "git-cli" to push changes using the Git CLI, or "github-api" to push changes via the GitHub API. When using "github-api", all commits and tags are signed using GitHub's GPG key and attributed to the user or app who owns the GITHUB_TOKEN. |
|
||||
| Inputs | Description |
|
||||
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `github-token` | The GitHub token to use for authentication. Defaults to the GitHub-provided token. To use a custom token, pass it explicitly to this input. |
|
||||
| `script` | The command to use to version packages |
|
||||
| `commit-message` | The commit message. Default to `Version Packages` |
|
||||
| `pr-title` | The pull request title. Default to `Version Packages` |
|
||||
| `pr-draft` | Controls draft PR behavior. Use 'create' to create new version PRs as draft, or 'always' to also convert existing version PRs back to draft when updating them. |
|
||||
| `pr-base-branch` | Sets the base branch of the PR. Defaults to `github.ref_name`. |
|
||||
| `push-with-git-cli` | Whether to use the Git CLI instead of the GitHub API to push release commits. Defaults to `false`. When using the GitHub API, commits are signed using GitHub's GPG key and attributed to the user or app that owns the `github-token`. |
|
||||
|
||||
| Outputs | Description |
|
||||
| ----------- | --------------------------------------------------- |
|
||||
|
||||
+8
-7
@@ -5,7 +5,9 @@ runs:
|
||||
main: ../dist/version.js
|
||||
inputs:
|
||||
github-token:
|
||||
description: "The GitHub token to use for authentication. Defaults to the GitHub-provided token."
|
||||
description: >
|
||||
The GitHub token to use for authentication. Defaults to the GitHub-provided token.
|
||||
To use a custom token, pass it explicitly to this input.
|
||||
required: false
|
||||
default: ${{ github.token }}
|
||||
script:
|
||||
@@ -25,14 +27,13 @@ inputs:
|
||||
pr-base-branch:
|
||||
description: "Sets the base branch of the PR. Defaults to `github.ref_name`."
|
||||
required: false
|
||||
commit-mode:
|
||||
push-with-git-cli:
|
||||
description: >
|
||||
An enum to specify the commit mode. Use "git-cli" to push changes using the Git CLI,
|
||||
or "github-api" to push changes via the GitHub API. When using "github-api",
|
||||
all commits and tags are signed using GitHub's GPG key and attributed to the user
|
||||
or app who owns the GITHUB_TOKEN.
|
||||
Whether to use the Git CLI instead of the GitHub API to push release commits.
|
||||
Defaults to `false`. When using the GitHub API, commits are signed using GitHub's
|
||||
GPG key and attributed to the user or app that owns the `github-token`.
|
||||
required: false
|
||||
default: "git-cli"
|
||||
default: false
|
||||
outputs:
|
||||
pr-number:
|
||||
description: The pull request number that was created or updated
|
||||
|
||||
Reference in New Issue
Block a user