Skip to content
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

feat: signed commit when renaming upstream module #61

Merged
merged 3 commits into from
Oct 17, 2024

Conversation

ARR4N
Copy link
Collaborator

@ARR4N ARR4N commented Oct 16, 2024

Why this should be merged

Signs commits for auto-renaming the Go module, originally introduced in #51 with unsigned commits that can't be merged to main.

How this works

Changes the commit action to use ghcommit, which was made specifically to allow for keyless signing (GitHub signs the commit). The workflow no longer opens a PR to the renamed-go-module branch as it's redundant and the generated branch can be used directly.

The commit message includes the workflow_dispatch trigger branch as well as a hash of the workflow file for a complete audit trail.

I removed the commented-out PR trigger as it's unnecessary. In development we can now just trigger the workflow on the dev branch.

How this was tested

Inspecting the commit generated by a workflow run. It is identical in modifications to the one reviewed in #59.

@ARR4N ARR4N requested review from a team, darioush, ceyonur and michaelkaplan13 and removed request for a team October 16, 2024 01:18
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
uses: devops-infra/[email protected]
- name: Commit to new branch
uses: planetscale/ghcommit-action@d4176bfacef926cc2db351eab20398dfc2f593b5 # v0.2.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious why not refer to v0.2.0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible to change a version tag to a different commit so this just reduces the attack surface.

@ARR4N ARR4N merged commit c6c8558 into main Oct 17, 2024
4 checks passed
@ARR4N ARR4N deleted the arr4n/keyless-signed-ci-commit branch October 17, 2024 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants