Add classification-labels input and add-labels safe output to Issue Triage - #1030
Conversation
…ssue-triage Agent-Logs-Url: https://github.com/elastic/ai-github-actions/sessions/e09ad63a-2941-4150-8412-17cb4b5a6094 Co-authored-by: fr4nc1sc0-r4m0n <215478872+fr4nc1sc0-r4m0n@users.noreply.github.com>
|
@copilot could make sense to create a fragment for the add-labels safe output to reuse this? |
…ragment Agent-Logs-Url: https://github.com/elastic/ai-github-actions/sessions/0446c92c-b22e-4b12-a729-014201ceaced Co-authored-by: fr4nc1sc0-r4m0n <215478872+fr4nc1sc0-r4m0n@users.noreply.github.com>
Done — created |
There was a problem hiding this comment.
Requesting changes: the new shared safe-output-add-labels fragment does not wire GH_AW_AGENT_OUTPUT into the sanitizer step, so allowlist filtering can be skipped depending on caller environment.
What is this? | From workflow: Trigger PR Review
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
| - name: Pre-sanitize labels from input allowlist | ||
| uses: actions/github-script@v7 | ||
| env: | ||
| CLASSIFICATION_LABELS: ${{ inputs.classification-labels }} |
There was a problem hiding this comment.
GH_AW_AGENT_OUTPUT is used by this script (const outputPath = process.env.GH_AW_AGENT_OUTPUT;) but it isn’t wired into this step’s env, so this sanitizer can silently no-op when the variable isn’t already present in the job environment.
That defeats the allowlist filtering (classification-labels) and can let unfiltered add_labels operations reach safe-output processing.
Please pass the output path explicitly here (for example from steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT) so the fragment is self-contained and consistently enforces the allowlist.
There was a problem hiding this comment.
@copilot apply the changes proposed in this comment #1030 (comment)
Already done — |
|
@copilot Address this issue in the fragment: file: .github/workflows/gh-aw-fragments/safe-output-add-labels.md |
Agent-Logs-Url: https://github.com/elastic/ai-github-actions/sessions/1d566878-3877-443f-8544-a4002ea92c83 Co-authored-by: fr4nc1sc0-r4m0n <215478872+fr4nc1sc0-r4m0n@users.noreply.github.com>
Fixed in db3cc4a. Added |
Agent-Logs-Url: https://github.com/elastic/ai-github-actions/sessions/76c6bc70-a281-49f1-be2a-027ddcb9a5f2 Co-authored-by: fr4nc1sc0-r4m0n <215478872+fr4nc1sc0-r4m0n@users.noreply.github.com>
Fixed in 7b96fff. The CI was failing because the lock files were out of sync — I had manually edited them instead of regenerating via |
| max: 3 | ||
| steps: | ||
| - name: Pre-sanitize labels from input allowlist | ||
| uses: actions/github-script@v7 |
There was a problem hiding this comment.
Done in 0fa6131 — updated safe-output-add-labels.md to actions/github-script@v9 and recompiled the lock files. The v7 pin is now gone from both gh-aw-dependency-review.lock.yml and gh-aw-issue-triage.lock.yml.
…agment Agent-Logs-Url: https://github.com/elastic/ai-github-actions/sessions/f5181716-39d3-4aed-b4e5-ebc3ade08e06 Co-authored-by: v1v <2871786+v1v@users.noreply.github.com>
Done here #1030 (comment)
|
@copilot I want to modify the gh-aw-issue-triage agentic workflow to receive a custom ephemeral token to be used in the pull request labeling safe output to allow events being triggered by this labeling action. |
This is already implemented in the current PR. The optional |
|
It's working fine: I think we can merge this one @v1v |
classification-labelsinput andadd-labelssafe output to Issue Triagegh-aw-fragments/safe-output-add-labels.mdreusable fragmentgh-aw-dependency-review.mdto import the new fragmentREADME.md/docs/andexample.ymlGH_AW_AGENT_OUTPUTenv var tosafe-output-add-labels.mdfragmentenv:blockmake compile(sync with fragment fix)actions/github-scriptfromv7tov9insafe-output-add-labels.md; recompile lock files