Repository navigation
Remove pull_request_template.md #279
Workflow file for this run
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
| # This workflow will triage pull requests and apply a label based on the | ||
|
Check warning on line 1 in .github/workflows/label.yml
|
||
| # paths that are modified in the pull request. It also applies the | ||
| # "AI assisted" label when a commit has an "Assisted-by:" trailer. | ||
| # | ||
| # To use this workflow, you will need to set up a .github/labeler.yml | ||
| # file with configuration. For more information, see: | ||
| # https://github.com/actions/labeler | ||
| name: Labeler | ||
| on: [pull_request_target] | ||
| jobs: | ||
| label: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| steps: | ||
| - uses: actions/labeler@v7.0.0 | ||
| with: | ||
| repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
| # Only reads the commit messages; the pull request is not checked out. | ||
| - name: Label pull requests with an Assisted-by trailer | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| REPO: ${{ github.repository }} | ||
| PR: ${{ github.event.pull_request.number }} | ||
| run: | | ||
| found=$(gh api "repos/$REPO/pulls/$PR/commits" --paginate \ | ||
| --jq '.[].commit.message | split("\n")[] | ascii_downcase | ||
| | select(startswith("assisted-by:"))') | ||
| if [ -n "$found" ]; then | ||
| gh api -X POST "repos/$REPO/issues/$PR/labels" \ | ||
| -f 'labels[]=AI assisted' | ||
| fi | ||