Repository navigation
feat(pr-classifiers): Add an action that runs the PR classifiers - #188
Merged
Merged
Conversation
Every repository that classifies its pull requests copied the same four steps: get a token for the internal getsentry/classifiers repository, check it out at a pinned commit, run its action and upload the result. Wrap them in one composite action so a repository only keeps the trigger, the permissions, the concurrency group and one step. The pinned classifiers commit now lives here, where a dependency updater can see it, instead of in a ref: line in each caller. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
|
Which classifiers run is decided in getsentry/classifiers. Listing them here would need an update with every new one. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
stephanie-anderson
marked this pull request as ready for review
November 24, 2026 17:57
dingsdax
approved these changes
Nov 25, 2026
This was referenced Nov 25, 2026
sentrivana
pushed a commit
to getsentry/sentry-python
that referenced
this pull request
Nov 26, 2026
### Description Adds `.github/workflows/pr-classifiers.yml`, which runs the shared `getsentry/github-workflows/pr-classifiers` action (getsentry/github-workflows#188), the same workflow as the other backend SDK repositories. It gives every pull request an advisory risk label (`risk: low`, `risk: medium` or `risk: high`) and keeps one summary comment that explains the label. The label is only a hint. It approves nothing and should not become a required check. The action gets a short-lived GitHub App token that can only read the internal getsentry/classifiers repository, checks it out at a pinned commit and runs the classifier from there. It never checks out or runs code from the pull request. The action is pinned to a full commit SHA. **Merge order:** merge #8392 (the fact sheet at `.github/classifiers.toml`) first. The classifier reads the fact sheet from the pull request's base branch and skips repositories without one. **Before merging**, this repository needs the `CLASSIFIERS_APP_CLIENT_ID` Actions variable, the `CLASSIFIERS_APP_KEY` and `AI_GATEWAY_API_KEY` Actions secrets, and the classifiers GitHub App's access to getsentry/classifiers. Without them, every PR shows a failing (non-required) "PR classifiers" check. The workflow runs on `pull_request_target`, so it does not run with this change on this PR and takes effect after merge. To undo it, revert this PR. #skip-changelog <!-- junior-request-attribution:start --> via @dingsdax. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:local%3Aweb%3Ad53e7f3f9d4c1313e2fafc28 --> -- [View Session](https://junior-prod.sentry.dev/conversations/local%3Aweb%3Ad53e7f3f9d4c1313e2fafc28) [[Sentry]](https://sentry.sentry.io/explore/conversations/local%3Aweb%3Ad53e7f3f9d4c1313e2fafc28/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: johdax <114897+dingsdax@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a
pr-classifierscomposite action that runs the internal getsentry/classifiers action on a pull request and puts the result on it as a label.sentry-java, sentry-go, sentry-elixir and sentry-dotnet each carry a copy of the same workflow today: get an app token for the internal repository, check it out at a pinned commit, run its action, upload the result. This wraps those four steps, so a caller keeps the trigger, the permissions, the concurrency group and one step. The pinned classifiers commit moves here as the default of
classifiers-ref, where it is bumped once instead of in aref:line per repository.It is a composite action rather than a reusable workflow to match what this repository moved to in v3. The cost is that the trigger, permissions and concurrency block stay in each caller, because a composite action cannot set them. The README gives the block to copy and explains why the concurrency expression must not be simplified.
The classifier reads the repository's fact sheet from
.github/classifiers.tomlat the pull request's base commit (getsentry/classifiers#12), so a repository needs that file on its default branch before it switches to this action.Not verified yet
This has not run on GitHub. The step I would check first is
uses: ./.classifiers/actions/prinside the composite action: it relies on a local path resolving against the workspace, where the previous step put the checkout. It needs one run on a test pull request in a repository that has the app credentials and the gateway key, which the workflow tests here cannot have.🤖 Generated with Claude Code