feat(eval): kb.effectiveness — does surfaced knowledge change outcomes? honest per-artifact impact #246
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
| name: comment-command | |
| # slash-command trigger: the owner comments `/auto-merge` on a PR to arm | |
| # auto-merge, as an alternative to applying the auto-merge label. review is done | |
| # by CodeRabbit + ci; arm-auto-merge.yml decides whether the PR clears the bar. | |
| on: | |
| issue_comment: | |
| types: [created] | |
| permissions: {} | |
| concurrency: | |
| group: comment-command-${{ github.event.issue.number }} | |
| cancel-in-progress: false | |
| jobs: | |
| parse: | |
| # only PR comments, only the trusted owner, only the /auto-merge command. | |
| if: > | |
| github.event.issue.pull_request && | |
| github.event.comment.author_association == 'OWNER' && | |
| github.event.comment.user.login == 'plind-junior' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| outputs: | |
| is_command: ${{ steps.cmd.outputs.is_command }} | |
| steps: | |
| - name: detect /auto-merge | |
| id: cmd | |
| env: | |
| BODY: ${{ github.event.comment.body }} | |
| run: | | |
| if printf '%s' "$BODY" | grep -Eiq '(^|[[:space:]])/auto-merge([[:space:]]|$)'; then | |
| echo "is_command=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "is_command=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: mark authorized | |
| if: steps.cmd.outputs.is_command == 'true' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| REPO: ${{ github.repository }} | |
| PR: ${{ github.event.issue.number }} | |
| run: | | |
| # mark authorized (visible, and enables deauthorize-on-push). a label | |
| # added via GITHUB_TOKEN does not re-trigger auto-merge.yml (GitHub's | |
| # token-recursion guard), so this does not double-arm. | |
| gh pr edit "$PR" --repo "$REPO" --add-label auto-merge || true | |
| # the issue_comment payload carries no head sha; arm-auto-merge resolves it. | |
| arm: | |
| needs: parse | |
| if: needs.parse.outputs.is_command == 'true' | |
| # a called workflow can only downgrade the caller's token, and this file | |
| # starts from `permissions: {}` — so the grant has to be made here too. | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| checks: read | |
| uses: ./.github/workflows/arm-auto-merge.yml | |
| with: | |
| pr: ${{ github.event.issue.number }} |