Skip to content

fix(ci): sign auto-generated docs commits#5154

Merged
Brend-Smits merged 4 commits into
mainfrom
gc/fix/verified-docs-commits
Jun 11, 2026
Merged

fix(ci): sign auto-generated docs commits#5154
Brend-Smits merged 4 commits into
mainfrom
gc/fix/verified-docs-commits

Conversation

@guicaulada

@guicaulada guicaulada commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

The update-docs workflow creates docs commits with a hand-set bot identity (github-aws-runners-pr|bot) while pushing with GITHUB_TOKEN. The resulting commits are unsigned, show as unverified, and don't resolve to any GitHub account (see dd5f00c on #5152verification.reason: unsigned, no linked author).

Key changes:

  • The terraform-docs step no longer commits or pushes (git-push: false); a new step creates the commit through the GraphQL createCommitOnBranch mutation instead. Commits created via the API are signed by GitHub and show as Verified, attributed to github-actions[bot]. This avoids adding a new third-party action dependency.
  • The main-branch PR path enables sign-commits: true on peter-evans/create-pull-request, which also creates commits via the API for the same effect.
  • The fork path is unchanged, since forks push to their own repositories.

Notes:

  • Pushing via createCommitOnBranch with GITHUB_TOKEN does not trigger new workflow runs, matching the previous git push behavior (no recursion).
  • The mkdocs gh-deploy commits to gh-pages remain unsigned; mkdocs commits locally via git, so it can't use the API. Its identity (github-actions[bot]) at least matches the token used.

Validated with actionlint and zizmor (no findings on this workflow).

Testing

Tested end-to-end on a throwaway branch (gc/test/verified-docs-commits) containing this workflow plus a deliberately stale doc (a tweaked variable description in modules/webhook/variables.tf without regenerating the READMEs):

  • No-change path: the run on this PR's branch exits cleanly with No documentation changes to commit. (run 27298488008)
  • Commit path: the run on the test branch regenerated 4 READMEs and created the commit via the API (run 27303747943) — see 5116de7, which shows as Verified:
$ gh api repos/github-aws-runners/terraform-aws-github-runner/commits/5116de7ddf1a45c52ec2b5ce2b702d7f0dbcf5d2 \
    --jq '{author: .commit.author, committer_login: .committer.login, verified: .commit.verification.verified, reason: .commit.verification.reason}'
{
  "author": {
    "date": "2026-06-10T20:19:54Z",
    "email": "41898282+github-actions[bot]@users.noreply.github.com",
    "name": "github-actions[bot]"
  },
  "committer_login": "web-flow",
  "verified": true,
  "reason": "valid"
}

Compare with the unverified commit that motivated this PR: dd5f00c has "verified": false, "reason": "unsigned" and no resolvable author account.

Testing also surfaced two fixes now included here: terraform-docs stages the files it updates, so the change detection diffs against HEAD; and the GraphQL payload is passed to jq via a temp file (--slurpfile) because embedding file contents in a CLI argument exceeded the kernel's per-argument size limit.

Docs commits were created with a hand-set app bot identity
(github-aws-runners-pr|bot) while pushing with GITHUB_TOKEN, so they
were unsigned, showed as unverified, and resolved to no GitHub account.

Create commits through the GitHub GraphQL API (createCommitOnBranch)
instead, which GitHub signs and attributes to github-actions[bot], and
enable sign-commits on create-pull-request for the main branch path.
@guicaulada guicaulada requested a review from a team as a code owner June 10, 2026 18:59
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

npalm
npalm previously approved these changes Jun 10, 2026

@npalm npalm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, but @guicaulada maybe make a tiny doc change, Some trival change. This will trigger a commit on the branch to proof it fix the probelm

terraform-docs stages updated files with git add, so an unstaged-only
diff reports no changes; compare against HEAD instead.

@Brend-Smits Brend-Smits left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great work, seems the terraform docs step is failing:

Run # diff against HEAD because terraform-docs stages the files it updates
/home/runner/work/_temp/6c1ec272-b350-4198-9822-211949289d07.sh: line 9: /usr/bin/jq: Argument list too long
gh: A query attribute must be specified and must be a string.
{"errors":[{"message":"A query attribute must be specified and must be a string."}]}
Error: Process completed with exit code 1.

guicaulada and others added 2 commits June 10, 2026 17:19
Passing the additions JSON as a jq argument exceeds the kernel's
per-argument limit once file contents are embedded; read it from a
temp file with --slurpfile instead and log the committed files.
@github-actions github-actions Bot requested a review from a team as a code owner June 10, 2026 20:19
@guicaulada

guicaulada commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Well... I tested in a gc/test/verified-docs-commits branch to not pollute the PR with unrelated commits, but seems documentation was outdated so we got 26a12b3 Verified on this PR either way 😅

@guicaulada guicaulada requested review from Brend-Smits and npalm June 10, 2026 20:26

@Brend-Smits Brend-Smits left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM :shipit:!

@Brend-Smits Brend-Smits merged commit a6af4d2 into main Jun 11, 2026
2 checks passed
@Brend-Smits Brend-Smits deleted the gc/fix/verified-docs-commits branch June 11, 2026 07:23
Brend-Smits pushed a commit that referenced this pull request Jun 11, 2026
🤖 I have created a release *beep* *boop*
---


##
[7.7.0](v7.6.1...v7.7.0)
(2026-06-11)


### Features

* Add feature to enable dynamic ec2 config via workflow labels
([#5003](#5003))
([c68445d](c68445d))
* add support for macos runners
([#4930](#4930))
([3e179a3](3e179a3))
* Introduce Amazon Linux 2023 ARM image
([#4780](#4780))
([e572ae5](e572ae5))
* relax cpu_options schema and add amd_sev_snp + nested_virtualization
support
([#5039](#5039))
([5a3746d](5a3746d))
* **runner-role:** Enable using separate IAM role for runners
([#4875](#4875))
([6642e57](6642e57))


### Bug Fixes

* **ci:** sign auto-generated docs commits
([#5154](#5154))
([a6af4d2](a6af4d2))
* **runners:** wire job_retry.lambda_memory_size and lambda_timeout
([#5120](#5120))
([404785e](404785e))
* **scale-up:** Add ec2:TerminateInstances permission to scale-up Lambda
IAM policy
([#5152](#5152))
([94c4e12](94c4e12))
* **scale-up:** prevent negative TotalTargetCapacity when runners exceed
maximum
([#5062](#5062))
([9ab7410](9ab7410))
* **webhook:** Fix publish events to EventBridge
([#5143](#5143))
([a72b737](a72b737))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: runners-releaser[bot] <194412594+runners-releaser[bot]@users.noreply.github.com>
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.

3 participants