From 5de35c786f0e9972b91f35e75f7e0a2c45f2a4e9 Mon Sep 17 00:00:00 2001 From: JoannaaKL Date: Mon, 30 Nov 2026 16:33:45 +0100 Subject: [PATCH 1/2] Fix PR triage activation and skip prior assessments --- .github/scripts/pr-already-triaged.sh | 14 ++++++++ .github/workflows/pr-triage-dispatch.yml | 9 +++++ .github/workflows/pr-triage.lock.yml | 45 ++++++++++++++++++------ .github/workflows/pr-triage.md | 25 +++++++++---- 4 files changed, 76 insertions(+), 17 deletions(-) create mode 100644 .github/scripts/pr-already-triaged.sh diff --git a/.github/scripts/pr-already-triaged.sh b/.github/scripts/pr-already-triaged.sh new file mode 100644 index 0000000000..94e195ebf1 --- /dev/null +++ b/.github/scripts/pr-already-triaged.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -euo pipefail + +pr="repos/${GH_REPO}/issues/$1" +labels=$(gh api "$pr" --jq '[.labels[].name] | any(. == "waiting-for-reply" or . == "invalid")') +if [[ "$labels" == true ]]; then + echo true + exit 0 +fi + +# The assessment stays on the PR even after a maintainer removes its label. +gh api --paginate "$pr/comments?per_page=100" \ + --jq 'any(.[]; .user.login == "github-actions[bot]" and (.body | test("(?m)^### AI Assessment: (Invalid|Missing Details)\\s*$")))' \ + | jq -s 'any' diff --git a/.github/workflows/pr-triage-dispatch.yml b/.github/workflows/pr-triage-dispatch.yml index 3a774181c3..c3663b4f7e 100644 --- a/.github/workflows/pr-triage-dispatch.yml +++ b/.github/workflows/pr-triage-dispatch.yml @@ -7,6 +7,7 @@ on: permissions: actions: write + contents: read pull-requests: read concurrency: @@ -21,6 +22,9 @@ jobs: MAX_RUNS_PER_DAY: 20 MAX_ATTEMPTS_PER_PR: 2 steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Start triage for pull requests from external contributors env: GH_TOKEN: ${{ github.token }} @@ -88,6 +92,11 @@ jobs: echo "Reached the limit of ${MAX_RUNS_PER_DAY} triage runs per day." break fi + already_triaged=$(bash .github/scripts/pr-already-triaged.sh "$number") + if [ "$already_triaged" = true ]; then + echo "Skipping already triaged #${number}" + continue + fi gh workflow run pr-triage.lock.yml -f pr_number="$number" echo "Started triage for #${number}" started=$((started + 1)) diff --git a/.github/workflows/pr-triage.lock.yml b/.github/workflows/pr-triage.lock.yml index 90fa8a2878..472803d115 100644 --- a/.github/workflows/pr-triage.lock.yml +++ b/.github/workflows/pr-triage.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"e13a7d8bd9218163a7572fcc502362ed40ab1a1a896df9ada77d82442b170b26","body_hash":"b6ed768becd73ce5562ffe7deabba04cb4f1533bf3a816ea449ac5a320ebc5da","compiler_version":"v1.0.1","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.103"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"ee9eacf98ff465b071e1062524442071ecade38ced1a64da3f0fb527e43d1d77","body_hash":"b6ed768becd73ce5562ffe7deabba04cb4f1533bf3a816ea449ac5a320ebc5da","compiler_version":"v1.0.1","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.103"}} # gh-aw-manifest: {"version":1,"secrets":["GH_AW_DEFAULT_OTLP_ENDPOINT","GH_AW_DEFAULT_OTLP_HEADERS","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"3d3c42e5aac5ba805825da76410c181273ba90b1","version":"v7.0.1"},{"repo":"actions/download-artifact","sha":"9000827ccba6bdab643e8b6fd33ac0654aef8333","version":"v8.0.2"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"949feb2413d6458794dcd2491c4babbbce0c15c1","version":"v7.1.0"},{"repo":"actions/upload-artifact","sha":"cf430e030ddbb5b0abf93d22962f4752f3646cd9","version":"v7.0.2"},{"repo":"github/gh-aw-actions/setup","sha":"221ba4f4319de6b8e809d1a15528b3ae6a818aa5","version":"v1.0.1"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.29.0","digest":"sha256:b14bd399376180b5649a9324be3b50fbfc82bfe8f0c80045840416b5a4e65b96","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.29.0@sha256:b14bd399376180b5649a9324be3b50fbfc82bfe8f0c80045840416b5a4e65b96"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.29.0","digest":"sha256:baff00b856a4bdc93bce134928c70af3d3492f2e518757115042040674d56b0b","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.29.0@sha256:baff00b856a4bdc93bce134928c70af3d3492f2e518757115042040674d56b0b"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.29.0","digest":"sha256:6e0cbf7f980beb78b5461563a8164f6439ca959bc93733d5a6b52972e523ed50","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.29.0@sha256:6e0cbf7f980beb78b5461563a8164f6439ca959bc93733d5a6b52972e523ed50"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.5.0","digest":"sha256:d3544a4222e7efeeeb38669d8a1af0c72691c55b8f6506b15aa5920f7f31b7bc","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.5.0@sha256:d3544a4222e7efeeeb38669d8a1af0c72691c55b8f6506b15aa5920f7f31b7bc"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:2c2ea524e648b91c8333ce246e3838fcf5b19ac70e45baac1a51b9207299749f","pinned_image":"ghcr.io/github/gh-aw-node@sha256:2c2ea524e648b91c8333ce246e3838fcf5b19ac70e45baac1a51b9207299749f"}],"mcp_servers":[{"name":"safeoutputs","tools":["add_comment","add_labels","noop","report_incomplete","report_missing_data","report_missing_tool"]}],"threat_detection":{"mode":"enabled"},"admission":false} # This file was automatically generated by gh-aw (v1.0.1). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # @@ -142,7 +142,7 @@ jobs: GH_AW_INFO_WORKFLOW_ID: ${{ job.workflow_ref }} GH_AW_INFO_EXPERIMENTAL: "false" GH_AW_INFO_SUPPORTS_TOOLS_ALLOWLIST: "true" - GH_AW_INFO_STAGED: "true" + GH_AW_INFO_STAGED: "false" GH_AW_INFO_ALLOWED_DOMAINS: '["defaults"]' GH_AW_INFO_FIREWALL_ENABLED: "true" GH_AW_INFO_AWF_VERSION: "v0.29.0" @@ -936,7 +936,6 @@ jobs: GH_AW_PHASE: agent GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }} - GH_AW_SAFE_OUTPUTS_STAGED: true GH_AW_TIMEOUT_MINUTES: 10 GH_AW_VERSION: v1.0.1 GITHUB_API_URL: ${{ github.api_url }} @@ -1180,10 +1179,11 @@ jobs: runs-on: ubuntu-latest # Permissions for the check job (workflow permissions default to none). permissions: + contents: read pull-requests: read outputs: failed_sections: ${{ steps.check.outputs.failed_sections }} - result: ${{ steps.check.outputs.result }} + result: ${{ steps.check.outputs.verdict }} steps: - name: Configure GH_HOST for enterprise compatibility id: ghes-host-config @@ -1194,19 +1194,32 @@ jobs: GH_HOST="${GITHUB_SERVER_URL#https://}" GH_HOST="${GH_HOST#http://}" echo "GH_HOST=${GH_HOST}" >> "$GITHUB_ENV" + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Check for prior triage + id: prior + run: | + already_triaged=$(bash .github/scripts/pr-already-triaged.sh "$PR_NUMBER") + echo "already_triaged=$already_triaged" >> "$GITHUB_OUTPUT" + env: + GH_REPO: ${{ github.repository }} + GH_TOKEN: ${{ github.token }} + PR_NUMBER: ${{ inputs.pr_number }} - name: Check the pull request against the template id: check + if: steps.prior.outputs.already_triaged == 'false' uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const prNumber = Number(context.payload.inputs.pr_number); const { data: pr } = await github.rest.pulls.get({ ...context.repo, pull_number: prNumber }); if (pr.state !== 'open' || pr.draft) { - core.setOutput('result', 'skip'); + core.setOutput('verdict', 'skip'); return; } if (pr.changed_files === 0) { - core.setOutput('result', 'invalid'); + core.setOutput('verdict', 'invalid'); return; } @@ -1279,7 +1292,7 @@ jobs: if (!lint || !(checked(lint) || hasText(lint))) failed.push('Lint & tests'); requireBox('Docs'); - core.setOutput('result', failed.length > 0 ? 'missing_details' : 'pass'); + core.setOutput('verdict', failed.length > 0 ? 'missing_details' : 'pass'); core.setOutput('failed_sections', failed.join(', ')); conclusion: @@ -1300,6 +1313,7 @@ jobs: permissions: actions: read issues: write + pull-requests: write concurrency: group: "gh-aw-conclusion-pr-triage-${{ inputs.pr_number }}" cancel-in-progress: false @@ -1976,7 +1990,8 @@ jobs: runs-on: ubuntu-slim # Permissions for the safe_outputs job (workflow permissions default to none). permissions: - issues: read + issues: write + pull-requests: write timeout-minutes: 15 env: GH_AW_AGENT_AIC: ${{ needs.agent.outputs.aic }} @@ -1989,7 +2004,6 @@ jobs: GH_AW_ENGINE_MODEL: ${{ needs.agent.outputs.model }} GH_AW_RUNTIME_FEATURES: ${{ vars.GH_AW_RUNTIME_FEATURES }} GH_AW_RUN_DETECTION: ${{ needs.detection.outputs.run_detection }} - GH_AW_SAFE_OUTPUTS_STAGED: "true" GH_AW_THREAT_DETECTION_AIC: ${{ needs.detection.outputs.aic }} GH_AW_WORKFLOW_ID: "pr-triage" GH_AW_WORKFLOW_NAME: "Pull Request Triage" @@ -2066,7 +2080,6 @@ jobs: GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1,\"target\":\"${{ inputs.pr_number }}\"},\"add_labels\":{\"allowed\":[\"waiting-for-reply\",\"invalid\"],\"max\":1,\"max_labels\":1,\"target\":\"${{ inputs.pr_number }}\"},\"noop\":{\"max\":2,\"report-as-issue\":\"false\"},\"report_incomplete\":{},\"report_missing_data\":{},\"report_missing_tool\":{}}" - GH_AW_SAFE_OUTPUTS_STAGED: "true" GH_AW_GITHUB_TOKEN_SOURCE: ${{ secrets.GH_AW_GITHUB_TOKEN != '' && 'pat' || 'github_actions' }} with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} @@ -2077,3 +2090,15 @@ jobs: setupGlobals(core, github, context, exec, io, getOctokit, process.env.GH_AW_GITHUB_TOKEN_SOURCE); const { main } = require(path.join(actionsDir, 'process_safe_outputs.cjs')); await main(); + - name: Upload Safe Outputs Items + if: always() + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: safe-outputs-items + path: | + /tmp/gh-aw/safe-output-items.jsonl + /tmp/gh-aw/safe-output-outcomes.jsonl + /tmp/gh-aw/temporary-id-map.json + /tmp/gh-aw/safe-output-errors.json + if-no-files-found: ignore + retention-days: ${{ vars.GH_AW_DEFAULT_ARTIFACT_RETENTION_DAYS || '0' }} diff --git a/.github/workflows/pr-triage.md b/.github/workflows/pr-triage.md index 36d40d5365..bc82b0e447 100644 --- a/.github/workflows/pr-triage.md +++ b/.github/workflows/pr-triage.md @@ -32,24 +32,38 @@ jobs: check: runs-on: ubuntu-latest permissions: + contents: read pull-requests: read outputs: - result: ${{ steps.check.outputs.result }} + result: ${{ steps.check.outputs.verdict }} failed_sections: ${{ steps.check.outputs.failed_sections }} steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Check for prior triage + id: prior + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + PR_NUMBER: ${{ inputs.pr_number }} + run: | + already_triaged=$(bash .github/scripts/pr-already-triaged.sh "$PR_NUMBER") + echo "already_triaged=$already_triaged" >> "$GITHUB_OUTPUT" - name: Check the pull request against the template id: check + if: steps.prior.outputs.already_triaged == 'false' uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const prNumber = Number(context.payload.inputs.pr_number); const { data: pr } = await github.rest.pulls.get({ ...context.repo, pull_number: prNumber }); if (pr.state !== 'open' || pr.draft) { - core.setOutput('result', 'skip'); + core.setOutput('verdict', 'skip'); return; } if (pr.changed_files === 0) { - core.setOutput('result', 'invalid'); + core.setOutput('verdict', 'invalid'); return; } @@ -122,7 +136,7 @@ jobs: if (!lint || !(checked(lint) || hasText(lint))) failed.push('Lint & tests'); requireBox('Docs'); - core.setOutput('result', failed.length > 0 ? 'missing_details' : 'pass'); + core.setOutput('verdict', failed.length > 0 ? 'missing_details' : 'pass'); core.setOutput('failed_sections', failed.join(', ')); tools: @@ -135,9 +149,6 @@ tools: max-ai-credits: 100 safe-outputs: - # Previews outputs in the run summary without writing anything. Remove this - # line once the previews look right. - staged: true # Keep run diagnostics in the Actions logs instead of public tracking issues. report-failure-as-issue: false report-missing-tool: From 208b2ca697e9a1c5e4d56f96ff79f0e16eec306b Mon Sep 17 00:00:00 2001 From: JoannaaKL Date: Tue, 1 Dec 2026 11:21:17 +0100 Subject: [PATCH 2/2] Recognize the configured PR triage writer --- .github/scripts/pr-already-triaged-test.sh | 30 ++++++++++++++++++++++ .github/scripts/pr-already-triaged.sh | 4 ++- .github/workflows/pr-triage-dispatch.yml | 1 + .github/workflows/pr-triage.lock.yml | 3 ++- .github/workflows/pr-triage.md | 2 ++ 5 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 .github/scripts/pr-already-triaged-test.sh diff --git a/.github/scripts/pr-already-triaged-test.sh b/.github/scripts/pr-already-triaged-test.sh new file mode 100644 index 0000000000..af187ee00b --- /dev/null +++ b/.github/scripts/pr-already-triaged-test.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -euo pipefail + +cd "$(dirname "$0")" +export GH_REPO=fixture/fixture PR_TRIAGE_WRITER_LOGIN='triage-app[bot]' + +gh() { + if [[ $2 == --paginate ]]; then + printf '[]\n' + jq -nc --arg author "$author" --arg body "$body" '[{user:{login:$author}, body:$body}]' + else + echo false + fi +} +export -f gh + +check() { + export author="$1" body="$2" + local actual + actual=$(bash pr-already-triaged.sh 1) + if [[ $actual != "$3" ]]; then + printf 'author=%s body=%s: expected %s, got %s\n' "$author" "$body" "$3" "$actual" >&2 + exit 1 + fi +} + +check 'triage-app[bot]' '### AI Assessment: Missing Details' true +check 'github-actions[bot]' '### AI Assessment: Invalid' true +check contributor '### AI Assessment: Missing Details' false +check 'triage-app[bot]' 'Unrelated comment' false diff --git a/.github/scripts/pr-already-triaged.sh b/.github/scripts/pr-already-triaged.sh index 94e195ebf1..6edc0dd96e 100644 --- a/.github/scripts/pr-already-triaged.sh +++ b/.github/scripts/pr-already-triaged.sh @@ -10,5 +10,7 @@ fi # The assessment stays on the PR even after a maintainer removes its label. gh api --paginate "$pr/comments?per_page=100" \ - --jq 'any(.[]; .user.login == "github-actions[bot]" and (.body | test("(?m)^### AI Assessment: (Invalid|Missing Details)\\s*$")))' \ + | jq --arg writer "${PR_TRIAGE_WRITER_LOGIN:?set the login that posts triage assessments}" \ + 'any(.[]; (.user.login == "github-actions[bot]" or .user.login == $writer) and + (.body | test("(?m)^### AI Assessment: (Invalid|Missing Details)\\s*$")))' \ | jq -s 'any' diff --git a/.github/workflows/pr-triage-dispatch.yml b/.github/workflows/pr-triage-dispatch.yml index c3663b4f7e..dbc2442c14 100644 --- a/.github/workflows/pr-triage-dispatch.yml +++ b/.github/workflows/pr-triage-dispatch.yml @@ -29,6 +29,7 @@ jobs: env: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} + PR_TRIAGE_WRITER_LOGIN: ${{ vars.PR_TRIAGE_WRITER_LOGIN || (secrets.GH_AW_GITHUB_TOKEN == '' && 'github-actions[bot]') || '' }} run: | set -euo pipefail since=$(date -u -d '7 days ago' +%Y-%m-%d) diff --git a/.github/workflows/pr-triage.lock.yml b/.github/workflows/pr-triage.lock.yml index 472803d115..4612244f8f 100644 --- a/.github/workflows/pr-triage.lock.yml +++ b/.github/workflows/pr-triage.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"ee9eacf98ff465b071e1062524442071ecade38ced1a64da3f0fb527e43d1d77","body_hash":"b6ed768becd73ce5562ffe7deabba04cb4f1533bf3a816ea449ac5a320ebc5da","compiler_version":"v1.0.1","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.103"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"5b93bb46b3be39bdf071c4ba157637a9bd51cacda3d7c1e3a9056c0d44733187","body_hash":"b6ed768becd73ce5562ffe7deabba04cb4f1533bf3a816ea449ac5a320ebc5da","compiler_version":"v1.0.1","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.103"}} # gh-aw-manifest: {"version":1,"secrets":["GH_AW_DEFAULT_OTLP_ENDPOINT","GH_AW_DEFAULT_OTLP_HEADERS","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"3d3c42e5aac5ba805825da76410c181273ba90b1","version":"v7.0.1"},{"repo":"actions/download-artifact","sha":"9000827ccba6bdab643e8b6fd33ac0654aef8333","version":"v8.0.2"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"949feb2413d6458794dcd2491c4babbbce0c15c1","version":"v7.1.0"},{"repo":"actions/upload-artifact","sha":"cf430e030ddbb5b0abf93d22962f4752f3646cd9","version":"v7.0.2"},{"repo":"github/gh-aw-actions/setup","sha":"221ba4f4319de6b8e809d1a15528b3ae6a818aa5","version":"v1.0.1"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.29.0","digest":"sha256:b14bd399376180b5649a9324be3b50fbfc82bfe8f0c80045840416b5a4e65b96","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.29.0@sha256:b14bd399376180b5649a9324be3b50fbfc82bfe8f0c80045840416b5a4e65b96"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.29.0","digest":"sha256:baff00b856a4bdc93bce134928c70af3d3492f2e518757115042040674d56b0b","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.29.0@sha256:baff00b856a4bdc93bce134928c70af3d3492f2e518757115042040674d56b0b"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.29.0","digest":"sha256:6e0cbf7f980beb78b5461563a8164f6439ca959bc93733d5a6b52972e523ed50","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.29.0@sha256:6e0cbf7f980beb78b5461563a8164f6439ca959bc93733d5a6b52972e523ed50"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.5.0","digest":"sha256:d3544a4222e7efeeeb38669d8a1af0c72691c55b8f6506b15aa5920f7f31b7bc","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.5.0@sha256:d3544a4222e7efeeeb38669d8a1af0c72691c55b8f6506b15aa5920f7f31b7bc"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:2c2ea524e648b91c8333ce246e3838fcf5b19ac70e45baac1a51b9207299749f","pinned_image":"ghcr.io/github/gh-aw-node@sha256:2c2ea524e648b91c8333ce246e3838fcf5b19ac70e45baac1a51b9207299749f"}],"mcp_servers":[{"name":"safeoutputs","tools":["add_comment","add_labels","noop","report_incomplete","report_missing_data","report_missing_tool"]}],"threat_detection":{"mode":"enabled"},"admission":false} # This file was automatically generated by gh-aw (v1.0.1). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # @@ -1206,6 +1206,7 @@ jobs: GH_REPO: ${{ github.repository }} GH_TOKEN: ${{ github.token }} PR_NUMBER: ${{ inputs.pr_number }} + PR_TRIAGE_WRITER_LOGIN: ${{ vars.PR_TRIAGE_WRITER_LOGIN || (secrets.GH_AW_GITHUB_TOKEN == '' && 'github-actions[bot]') || '' }} - name: Check the pull request against the template id: check if: steps.prior.outputs.already_triaged == 'false' diff --git a/.github/workflows/pr-triage.md b/.github/workflows/pr-triage.md index bc82b0e447..f568a1b7fd 100644 --- a/.github/workflows/pr-triage.md +++ b/.github/workflows/pr-triage.md @@ -46,6 +46,8 @@ jobs: env: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} + # When overriding the safe-output token, set this repository variable to its comment author's login. + PR_TRIAGE_WRITER_LOGIN: ${{ vars.PR_TRIAGE_WRITER_LOGIN || (secrets.GH_AW_GITHUB_TOKEN == '' && 'github-actions[bot]') || '' }} PR_NUMBER: ${{ inputs.pr_number }} run: | already_triaged=$(bash .github/scripts/pr-already-triaged.sh "$PR_NUMBER")