name: "Labelling new pull requests"
permissions:
contents: read
on:
pull_request_target:
types:
- opened
- reopened
- ready_for_review
- synchronize
jobs:
greeter:
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: >-
(github.repository == 'llvm/llvm-project') &&
(github.event.action == 'opened') &&
(github.event.pull_request.author_association != 'COLLABORATOR') &&
(github.event.pull_request.author_association != 'CONTRIBUTOR') &&
(github.event.pull_request.author_association != 'MANNEQUIN') &&
(github.event.pull_request.author_association != 'MEMBER') &&
(github.event.pull_request.author_association != 'OWNER')
steps:
- name: Checkout Automation Script
uses: actions/checkout@v4
with:
sparse-checkout: llvm/utils/git/
ref: main
- name: Setup Automation Script
working-directory: ./llvm/utils/git/
run: |
pip install --require-hashes -r requirements.txt
- name: Greet Author
working-directory: ./llvm/utils/git/
run: |
python3 ./github-automation.py \
--token '${{ secrets.GITHUB_TOKEN }}' \
pr-greeter \
--issue-number "${{ github.event.pull_request.number }}"
automate-prs-labels:
needs: greeter
runs-on: ubuntu-latest
if: >
always() && github.repository == 'llvm/llvm-project' &&
github.event.pull_request.draft == false &&
github.event.pull_request.commits < 10
steps:
- uses: actions/labeler@v4
with:
configuration-path: .github/new-prs-labeler.yml
sync-labels: ''
repo-token: ${{ secrets.ISSUE_SUBSCRIBER_TOKEN }}