Unverified Commit b7d385e8 authored by Lianmin Zheng's avatar Lianmin Zheng Committed by GitHub
Browse files

automatically label pr for ci (#10435)

parent 305c9e8c
name: Label PRs for CI
# This workflow runs on pull requests that are opened or reopened.
on:
pull_request_target:
types: [opened, reopened]
# Sets the permissions for the GITHUB_TOKEN to allow adding labels.
permissions:
pull-requests: write
jobs:
labeler:
runs-on: ubuntu-latest
steps:
- name: Add 'run-ci' label for authors with write access
# This 'if' condition checks the PR author's association with the repository.
# It proceeds only if the author is an OWNER, MEMBER, or COLLABORATOR.
if: >
contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR"]'),
github.event.pull_request.author_association)
uses: actions/github-script@v7
with:
script: |
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['run-ci']
})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment