Skip to content

ci(guard): refuse agent session links in commits and PR descriptions - #51

Merged
github-actions[bot] merged 1 commit into
mainfrom
ci/838-session-links
Nov 7, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
ci/838-session-links

Conversation

@znerol2

@znerol2 znerol2 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part of dmfdeploy/dmfdeploy#838: keep agent session links out of PRs and commits. This applies the follow-up for this repo listed in dmfdeploy/dmfdeploy#840.

  • Commits: the commitlint step scans the full message of every commit, merge commits included, and fails when one links to an agent session.
  • Description: the issue-link step fails on such a link before its no-issue exit, and edited re-runs it after a description edit. Every guard job re-runs on an edit. That's deliberate: skipping the scans on edited would let an edit cancel a push's scan run and then pass with the scan skipped.
  • Public logs: failures name the commit by short SHA and the rule, never the message text.
  • 250-commit limit: the commits API lists at most 250 commits, so commitlint and dco fail closed when they checked fewer commits than the PR holds, or when the PR's commit count is missing or not a number.

guard.yml and dco.yml were byte-identical across dmf-central, dmf-env, dmf-infra, dmf-init, dmf-media, dmf-promsd and dmf-runbooks, and stay identical after this change.

Verification

  • A harness extracts each changed inline script from the workflow YAML and runs it against a stubbed gh: 27 of 27 cases pass; 19 of them fail against origin/main.
  • actionlint passes on both files.
  • guard.yml runs on pull_request from the PR's own workflow file, so this PR's checks run the new steps.

Refs dmfdeploy/dmfdeploy#838

The commitlint step now scans the full message of every commit, merge
commits included, and fails when one links to an agent session. The
issue-link step checks the PR description for the same link before the
no-issue exit, and `edited` re-runs it after a description edit.

Failures name the commit by its short SHA and the rule, never the message
text, so a public log cannot repeat the link. The match is
case-insensitive.

The commits API lists at most 250 commits, so the commitlint and DCO steps
now fail closed when they checked fewer commits than the PR holds, or when
the PR's commit count is missing or not a number.

Refs dmfdeploy/dmfdeploy#838

Signed-off-by: znerol2 <6800371+znerol2@users.noreply.github.com>
@znerol2
znerol2 requested a review from a team as a code owner November 7, 2026 05:27
@github-actions
github-actions Bot enabled auto-merge (rebase) November 7, 2026 05:28

@lkirc lkirc left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed dc9748b: no blocking findings. The workflow changes preserve scans on PR edits, scan full commit messages without logging links, and fail closed if the commits API cannot cover the PR.

@github-actions
github-actions Bot merged commit 5fa1341 into main Nov 7, 2026
20 of 21 checks passed
@znerol2
znerol2 deleted the ci/838-session-links branch November 8, 2026 17:44
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