-
Notifications
You must be signed in to change notification settings - Fork 230
33 lines (31 loc) · 1.27 KB
/
pr-labeled-checklist.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# This action adds checklists from .github/pr-checklists/
# to PR conversations
# when a PR is targeted at a specific branch (branches)
# and a specific label (labels) are assigned.
#
# Checklist file name must match label name and end with '.md' extension.
#
# This action uses:
# - actions/checkout@v3
# - oleksiyrudenko/[email protected] (an updated fork of machine-learning-apps/pr-comment@master)
on:
pull_request_target:
types: [ labeled ]
branches:
- master
- main
jobs:
add-pr-checklist:
# define Eligible Labels; consider also using startsWith method
# (see also https://docs.github.com/en/actions/learn-github-actions/expressions#startswith)
if: contains( fromJson('["app-code-PR", "data-deletion", "merge-conflict"]'), github.event.label.name )
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# use https://github.com/actions/download-artifact to get templates from a resource other than the PR's targeted branch
# use https://github.com/actions/github-script to use GtiHub Action API methods immediately in the workflow
- uses: oleksiyrudenko/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: .github/pr-checklists/${{ github.event.label.name }}.md