-
Notifications
You must be signed in to change notification settings - Fork 166
Make bots sign their commits #8963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
andrewlock
wants to merge
9
commits into
master
Choose a base branch
from
andrew/sign-workflow-commits
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
27d4dc8
Add create-signed-pull-request composite action
andrewlock a76eb4e
Sign commits in auto_bump_smoke_test_docker_images
andrewlock 97f074e
Sign commits in auto_bump_test_package_versions
andrewlock 0820759
Sign commits in auto_create_version_bump_pr
andrewlock 1f042fb
Sign commits in force_manual_version_bump
andrewlock 6d01c7b
Sign the commit in create_hotfix_branch
andrewlock c41876e
Sign the commit in generate_package_versions
andrewlock ac7394b
Require signatures on every commit
andrewlock 01acf9a
Simplify signing by delegating to peter-evans/create-pull-request
andrewlock File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| name: 'Create Signed Pull Request' | ||
| description: 'Creates or updates a pull request whose commit is signed by GitHub' | ||
|
|
||
| # Thin wrapper over peter-evans/create-pull-request that always sets sign-commits | ||
| # Signing needs a bot token: our dd-octo-sts tokens are GitHub App tokens, so the commit is signed | ||
| # and attributed to the app. A PAT would silently produce unsigned commits. | ||
|
|
||
| inputs: | ||
| token: | ||
| description: 'GitHub App token used to commit and manage the pull request. Needs contents:write and pull_requests:write.' | ||
| required: true | ||
| branch: | ||
| description: 'Head branch to create or update' | ||
| required: true | ||
| commit-message: | ||
| description: 'Message for the commit' | ||
| required: true | ||
| title: | ||
| description: 'Pull request title' | ||
| required: true | ||
| base: | ||
| description: 'Base branch for the pull request. Defaults to the branch that was checked out.' | ||
| required: false | ||
| body: | ||
| description: 'Pull request body' | ||
| required: false | ||
| labels: | ||
| description: 'Comma-separated labels to apply' | ||
| required: false | ||
| reviewers: | ||
| description: 'Comma-separated reviewers to request. GitHub usernames, not teams.' | ||
| required: false | ||
|
|
||
| outputs: | ||
| pull-request-number: | ||
| description: 'Number of the created or updated pull request' | ||
| value: ${{ steps.pr.outputs.pull-request-number }} | ||
| pull-request-url: | ||
| description: 'URL of the created or updated pull request' | ||
| value: ${{ steps.pr.outputs.pull-request-url }} | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Create pull request | ||
| id: pr | ||
| uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 | ||
| with: | ||
| token: ${{ inputs.token }} | ||
| sign-commits: true | ||
| branch: ${{ inputs.branch }} | ||
| commit-message: ${{ inputs.commit-message }} | ||
| title: ${{ inputs.title }} | ||
| base: ${{ inputs.base }} | ||
| body: ${{ inputs.body }} | ||
| labels: ${{ inputs.labels }} | ||
| reviewers: ${{ inputs.reviewers }} | ||
| delete-branch: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a
v1.*orv2.*release is published, the earlier checkout replaces the workspace withrelease/1.xorrelease/2.x. Because this composite action is newly added on master, those existing branches do not receive.github/actions/create-signed-pull-request/action.ymlautomatically, so the runner will stop at this step instead of creating the version-bump PR. Invoke the pinned third-party action directly here, separately check out/copy the composite action, or backport it to every selected branch.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably "meh" seeing as we're not actually creating releases from those branches any more...