diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-08-26 08:41:02 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-26 08:41:02 -0400 |
| commit | dad084c3947df430bd0ee62bc96feb389d2bfe2b (patch) | |
| tree | c66559e4ddc44423beffa362890ac5c1b2dadacf /.github | |
| parent | e7ae1b3c10ad16713b0f0353eb2bb445b0e73c89 (diff) | |
| download | rneovim-dad084c3947df430bd0ee62bc96feb389d2bfe2b.tar.gz rneovim-dad084c3947df430bd0ee62bc96feb389d2bfe2b.tar.bz2 rneovim-dad084c3947df430bd0ee62bc96feb389d2bfe2b.zip | |
ci: merge "ai-assisted" job into "label" #41509
Problem:
Too many "jobs" listed in the CI report.
Solution:
- Do the "ai-assisted" step in the "label" job. No need for them to be
separate.
- Also drop the "already labeled" check; `gh pr edit --add-label` is
idempotent.
- Note: AI-assisted PRs are now labeled only on the "opened" event,
which is fine.
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/labeler_pr.yml | 43 |
1 files changed, 13 insertions, 30 deletions
diff --git a/.github/workflows/labeler_pr.yml b/.github/workflows/labeler_pr.yml index e9989233d0..946e82a71f 100644 --- a/.github/workflows/labeler_pr.yml +++ b/.github/workflows/labeler_pr.yml @@ -34,6 +34,19 @@ jobs: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+\((.+)\)!?:.*|\1|')" || true gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" || true + - name: "AI-assisted" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + PR_NUMBER: ${{ github.event.pull_request.number }} + run: | + set -euo pipefail + # AGENTS.md: AI-assisted commits are disclosed with an "AI-assisted" trailer. + commit_messages=$(gh api "repos/$GH_REPO/pulls/$PR_NUMBER/commits" --paginate --jq '.[].commit.message') + if grep -Eiq '\bAI-assisted\b' <<< "$commit_messages"; then + gh pr edit "$PR_NUMBER" --add-label 'AI assisted 🤖' + fi + - name: "target:release" if: startsWith(github.base_ref, 'release') uses: actions/github-script@v9 @@ -46,36 +59,6 @@ jobs: labels: ['target:release'] }) - ai-assisted: - runs-on: ubuntu-latest - permissions: - pull-requests: write - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_REPO: ${{ github.repository }} - PR_NUMBER: ${{ github.event.pull_request.number }} - AI_LABEL: 'AI assisted 🤖' - steps: - - name: "Label PRs with disclosed AI-assisted commits" - shell: bash - run: | - set -euo pipefail - - commit_messages=$(gh api "repos/$GH_REPO/pulls/$PR_NUMBER/commits" --paginate --jq '.[].commit.message') - - if ! grep -Eiq '\bAI-assisted\b' <<< "$commit_messages"; then - # No AI disclosure found in commits - exit 0 - fi - - pr_labels=$(gh pr view "$PR_NUMBER" --json labels --jq '.labels[].name') - if grep -Fxq "$AI_LABEL" <<< "$pr_labels"; then - # Already has label - exit 0 - fi - - gh pr edit "$PR_NUMBER" --add-label "$AI_LABEL" - no-ai-advertisements: runs-on: ubuntu-latest permissions: |