From e481b430e199d7e5c0041588cba6e319990842c7 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Mon, 30 Nov 2026 12:24:56 +0000 Subject: [PATCH 1/3] ci: Add the PR classifiers workflow Runs the shared getsentry/github-workflows/pr-classifiers action on pull requests, which puts a risk label on each one. It reads the fact sheet already at .github/classifiers.toml. Co-Authored-By: Chris Aigner <25478494+christophaigner@users.noreply.github.com> --- .github/workflows/pr-classifiers.yml | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/pr-classifiers.yml diff --git a/.github/workflows/pr-classifiers.yml b/.github/workflows/pr-classifiers.yml new file mode 100644 index 0000000000..10cf3c837c --- /dev/null +++ b/.github/workflows/pr-classifiers.yml @@ -0,0 +1,35 @@ +name: PR classifiers + +on: + # zizmor: ignore[dangerous-triggers] -- needs secrets on fork PRs; checks out no PR code. + pull_request_target: + # Keep `edited`: it is the only event fired when the base branch changes. + types: [opened, synchronize, reopened, ready_for_review, edited, converted_to_draft] + +permissions: {} + +concurrency: + # Two groups per pull request. Runs started by a title or description edit ("text") must + # never share a group with the runs that score a commit ("score"): GitHub keeps only one + # pending run per group, so a pending edit run would replace the pending run for a new + # commit and leave the previous commit's label on the PR. Do not simplify this expression. + group: pr-classifiers-${{ github.event.pull_request.number }}-${{ github.event.action == 'edited' && !github.event.changes.base && 'text' || 'score' }} + # Every started run must reach its label clear; an overtaken run ends as `pr_changed`. + cancel-in-progress: false + +jobs: + classify: + name: PR classifiers + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + pull-requests: write # this job only; needed to publish the risk label + steps: + # This job must never check out or run code from the pull request: it runs on + # pull_request_target and holds secrets. The classifier reads the PR's commits itself. + - uses: getsentry/github-workflows/pr-classifiers@edc87d6f133ac6204e22dee5123167a5eff3ed79 + with: + app-client-id: ${{ vars.CLASSIFIERS_APP_CLIENT_ID }} + app-private-key: ${{ secrets.CLASSIFIERS_APP_KEY }} + ai-gateway-api-key: ${{ secrets.AI_GATEWAY_API_KEY }} From 7a7021b404352c900bb3dcb06aa5686b68a5dcdf Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Mon, 30 Nov 2026 12:31:25 +0000 Subject: [PATCH 2/3] ci: Post the PR classifiers summary comment Co-Authored-By: Chris Aigner <25478494+christophaigner@users.noreply.github.com> --- .github/workflows/pr-classifiers.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-classifiers.yml b/.github/workflows/pr-classifiers.yml index 10cf3c837c..7cfa68fad2 100644 --- a/.github/workflows/pr-classifiers.yml +++ b/.github/workflows/pr-classifiers.yml @@ -24,7 +24,7 @@ jobs: timeout-minutes: 10 permissions: contents: read - pull-requests: write # this job only; needed to publish the risk label + pull-requests: write # this job only; needed to publish the risk label and the summary comment steps: # This job must never check out or run code from the pull request: it runs on # pull_request_target and holds secrets. The classifier reads the PR's commits itself. @@ -33,3 +33,4 @@ jobs: app-client-id: ${{ vars.CLASSIFIERS_APP_CLIENT_ID }} app-private-key: ${{ secrets.CLASSIFIERS_APP_KEY }} ai-gateway-api-key: ${{ secrets.AI_GATEWAY_API_KEY }} + publish-comment: true From 9a1dade48d1b6e63678341b854e41e4adb1c53d1 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Mon, 30 Nov 2026 12:38:43 +0000 Subject: [PATCH 3/3] ci: Match the sentry-java PR classifiers workflow Co-Authored-By: Chris Aigner <25478494+christophaigner@users.noreply.github.com> --- .github/workflows/pr-classifiers.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr-classifiers.yml b/.github/workflows/pr-classifiers.yml index 7cfa68fad2..fd6860d7bb 100644 --- a/.github/workflows/pr-classifiers.yml +++ b/.github/workflows/pr-classifiers.yml @@ -1,7 +1,6 @@ name: PR classifiers on: - # zizmor: ignore[dangerous-triggers] -- needs secrets on fork PRs; checks out no PR code. pull_request_target: # Keep `edited`: it is the only event fired when the base branch changes. types: [opened, synchronize, reopened, ready_for_review, edited, converted_to_draft] @@ -10,9 +9,10 @@ permissions: {} concurrency: # Two groups per pull request. Runs started by a title or description edit ("text") must - # never share a group with the runs that score a commit ("score"): GitHub keeps only one - # pending run per group, so a pending edit run would replace the pending run for a new - # commit and leave the previous commit's label on the PR. Do not simplify this expression. + # never share a group with the runs that score a revision ("score"): GitHub keeps only one + # pending run per group, so a pending text edit would replace the pending run for a new + # commit, and the action would then skip the edit because the previous commit's label is + # still on the PR. Do not simplify this expression. group: pr-classifiers-${{ github.event.pull_request.number }}-${{ github.event.action == 'edited' && !github.event.changes.base && 'text' || 'score' }} # Every started run must reach its label clear; an overtaken run ends as `pr_changed`. cancel-in-progress: false @@ -24,10 +24,9 @@ jobs: timeout-minutes: 10 permissions: contents: read - pull-requests: write # this job only; needed to publish the risk label and the summary comment + pull-requests: write # this job only; needed to publish the risk label and the summary comment steps: - # This job must never check out or run code from the pull request: it runs on - # pull_request_target and holds secrets. The classifier reads the PR's commits itself. + # This job must never check out or run code from the pull request. - uses: getsentry/github-workflows/pr-classifiers@edc87d6f133ac6204e22dee5123167a5eff3ed79 with: app-client-id: ${{ vars.CLASSIFIERS_APP_CLIENT_ID }}