forked from kottans/frontend-2022-homeworks
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (47 loc) · 2.26 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# 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/pr-comment@v1.1 (an updated fork of machine-learning-apps/pr-comment@master)
on:
pull_request_target:
types: [ labeled ]
branches:
- master
- main
jobs:
pr-basic-checks:
# define Eligible Labels; consider also using startsWith method
# (see also https://docs.github.com/en/actions/learn-github-actions/expressions#startswith)
if: contains( fromJson('["bad-pr-intro", "irrelevant-files", "irrelevant-commits"]'), 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/pr-comment@v1.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SOURCES: '["_greeting.md", "${{ github.event.label.name }}.md", "_signature.md"]'
with:
path: .github/pr-checklists/
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('["task-PopUp", "task-DOM", "task-TJSW", "task-Frogger", "task-TJSW-OOP", "task-Friends"]'), 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/pr-comment@v1.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SOURCES: '["_greeting.md", "_requirements_intro.md", "${{ github.event.label.name }}.md", "_requirements_outro.md", "_signature.md"]'
with:
path: .github/pr-checklists/