Skip to content

fix(ci): validate PR titles with read-only pull_request permissions - #397

Merged
Nan Liu (liunan-ms) merged 2 commits into
mainfrom
liunan/pr-title-check
Oct 23, 2026
Merged

Nan Liu (liunan-ms) merged 2 commits into
mainfrom
liunan/pr-title-check

Conversation

@liunan-ms

@liunan-ms Nan Liu (liunan-ms) commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Context

On November 2, 2026, GitHub will automatically enforce a default rule blocking pull_request_target workflows for affected public repositories. The default applies to public repositories without an applicable event policy; enforcement covers affected repositories that were using the default pull_request_target policy before general availability.

Under that default, the existing PR-title workflow would stop running unless explicitly allowed by an applicable Actions event policy. Switching to pull_request avoids depending on such an exception and keeps PR-title validation compatible with the new default.

Changes

  • Replace pull_request_target with pull_request, retaining the opened, edited, and reopened events.
  • Keep workflow-level permissions: {} and reduce the validation job to pull-requests: read.
  • Remove the PR-comment creation/deletion steps and their unused step ID. Invalid titles are still reported by the validation check, without posting PR comments.
  • Preserve the pinned semantic-title action, concurrency settings, and relevant comments; remove comments specific to the old trigger and commenting steps.

Validation

  • git --no-pager diff --check main...HEAD - passed.
  • ruby -r yaml -e 'YAML.load_file(".github/workflows/check-pr-title.yml"); puts "YAML syntax OK"' - passed.
  • GitHub Actions execution has not been verified. zizmor and actionlint were not run because they are unavailable locally.
  • Go build, unit tests, and scenario tests were not run because this change only updates a GitHub Actions workflow.

Copilot AI balanced review requested due to automatic review settings October 20, 2026 23:45

Copilot AI 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.

🟡 Changes recommended

Missing synchronize events leave pushed revisions without validation and can block merging when the check is required.

1 open issue
What changed in this PR

Moves PR-title validation to a read-only pull_request workflow, avoiding reliance on pull_request_target exceptions.

Changes:

  • Switches triggers and reduces permissions to pull-requests: read.
  • Removes PR-comment steps while preserving the pinned validation action and concurrency settings.
File Description
.github/​workflows/​check-pr-title.yml Updates the trigger, reduces permissions, and removes commenting.

Review effort: Balanced

Comment thread .github/workflows/check-pr-title.yml Resolved
Copilot AI balanced review requested due to automatic review settings October 21, 2026 00:13

Copilot AI 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.

🟢 Approval recommended

No blocking issues were identified in this narrowly scoped workflow change, though Actions execution remains unverified.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@liunan-ms
Nan Liu (liunan-ms) marked this pull request as ready for review October 21, 2026 00:31
Copilot AI balanced review requested due to automatic review settings October 23, 2026 22:04

Copilot AI 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.

🟢 Approval recommended

The focused workflow change preserves title validation with read-only permissions, and no unresolved blocking issues remain.

No open issues 🎉

Review effort: Balanced

@liunan-ms
Nan Liu (liunan-ms) merged commit 6e15d9f into main Oct 23, 2026
19 of 20 checks passed
@liunan-ms
Nan Liu (liunan-ms) deleted the liunan/pr-title-check branch October 23, 2026 23:18
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.

4 participants