-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (33 loc) · 1.25 KB
/
initiate-tests.yaml
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
on:
pull_request:
branches: [ main ]
types: opened
issue_comment:
types: created
jobs:
act-on-pr-creation:
runs-on: ubuntu-latest
steps:
- name: add comment to PR
if: ${{ github.event.action == 'opened' }}
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Thank you for contributing to the ops-terra-utils repo! \n A test suite will now begin running to ensure that no breaking changes are made.\n If these tests fail you can have them re-run after making changes by commenting `/run_tests`'
})
- name: add label
if: ${{ github.event.action == 'opened' || contains(github.event.comment.body, '/run_tests') }}
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_ACCESS_TOKEN }}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['run-test-suite']
})