ci: update global workflows (#532)
This commit is contained in:
50
.github/workflows/autoupdate-labeler.yml
vendored
Normal file
50
.github/workflows/autoupdate-labeler.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
---
|
||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
name: Label PR autoupdate
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- edited
|
||||
- opened
|
||||
|
||||
jobs:
|
||||
label_pr:
|
||||
if: >-
|
||||
startsWith(github.repository, 'LizardByte/') &&
|
||||
contains(github.event.pull_request.body, fromJSON('"] I want maintainers to keep my branch updated\r"'))
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Label autoupdate
|
||||
if: >-
|
||||
contains(github.event.pull_request.body,
|
||||
fromJSON('"\n- [x] I want maintainers to keep my branch updated\r"')) == true
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
script: |
|
||||
github.rest.issues.addLabels({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
labels: ['autoupdate']
|
||||
})
|
||||
|
||||
- name: Unlabel autoupdate
|
||||
if: >-
|
||||
contains(github.event.pull_request.body,
|
||||
fromJSON('"\n- [x] I want maintainers to keep my branch updated\r"')) == false &&
|
||||
contains(github.event.pull_request.labels.*.name, 'autoupdate')
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
script: |
|
||||
github.rest.issues.removeLabel({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
name: ['autoupdate']
|
||||
})
|
||||
Reference in New Issue
Block a user