Skip to content

ci: run the PR title check on pull_request - #150

Merged
scottlovegrove merged 2 commits into
mainfrom
scottl/semantic-pr-pull-request-trigger
Dec 4, 2026
Merged

scottlovegrove merged 2 commits into
mainfrom
scottl/semantic-pr-pull-request-trigger

Conversation

@scottlovegrove

@scottlovegrove scottlovegrove commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Since 3 December every run of this repo's PR title check has failed at startup ("This run likely failed because of a workflow file issue"). The same workflow file, byte for byte, keeps passing in the private repos that use it (aist-sdk-typescript, product-libraries-tokens), and the only pull_request_target workflows in the org that fail this way are this one and its copies in the other two public repos (comms-cli, todoist-sdk-typescript, twist-cli). Public repos that run the check on pull_request (typist, react-compiler-tracker, todoist-mcp) kept passing on the same action version, so what fails is pull_request_target in a public repo, not the action. Moving the action to Node 24 in #149 didn't change that.

This runs the check on pull_request instead, as typist and the org's other public repos do, and limits its token to pull-requests: read, the only access it needs: the action fetches the pull request to read its current title. Without a permissions block the job got the repository's default write token.

pull_request runs the workflow file from the PR itself, so this PR's own title check exercises the change.

Since 3 December every pull_request_target run of this workflow fails
at startup. The same file passes in private repos, and public repos
that run the check on pull_request keep passing, so the trigger is
what fails in a public repo. The check only reads the PR title, so it
doesn't need pull_request_target's base-branch token.
@scottlovegrove scottlovegrove self-assigned this Dec 4, 2026

@doistbot doistbot 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.

This PR switches the semantic PR title check from pull_request_target to pull_request, making the workflow match the working setup in the org's other public repos. No inline issues were flagged — the change is a single-line trigger swap that only reduces privilege: the job reads the PR title only, checks out no PR code, and gets a read-only token under pull_request. Since pull_request runs the workflow file from the PR itself, this PR's own title check exercises the change, so a green run here is the verification.

I also left one optional follow-up note in the details below.

Optional follow-up note (1)
  • P3 .github/workflows/check-semantic-pull-request.yml:4: Now that the workflow runs on pull_request, add an explicit least-privilege permissions block. Every other pull_request workflow here (lint.yml, test.yml, check-skill-sync.yml) declares one, and without it this job inherits the repo's default token scope — write-capable for same-repo branches, when all the action needs is to read the title from the event payload. yaml on: pull_request: types: - edited - opened - synchronize permissions: contents: read

Share Feedback • Review Logs • Trace

The action fetches the pull request to read its current title, so
pull-requests: read is all it needs. Without a permissions block the
job got the repository's default write token.
@scottlovegrove scottlovegrove added the 🚢 Ship PR requires passing checks before merge, but no independent human review. label Dec 4, 2026
@scottlovegrove
scottlovegrove merged commit 6e5a887 into main Dec 4, 2026
7 checks passed
@scottlovegrove
scottlovegrove deleted the scottl/semantic-pr-pull-request-trigger branch December 4, 2026 15:58
@doist-release-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 6.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released 🚢 Ship PR requires passing checks before merge, but no independent human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants