-
-
Notifications
You must be signed in to change notification settings - Fork 88
59 lines (55 loc) · 2.35 KB
/
test-sdc-tasks.yml
File metadata and controls
59 lines (55 loc) · 2.35 KB
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
50
51
52
53
54
55
56
57
58
59
name: Test SDC Tasks
on:
pull_request_target:
types:
- labeled
- unlabeled
- opened
- edited
- reopened
jobs:
test_sdc_tasks:
name: Test SDC Tasks
runs-on: ubuntu-slim
permissions:
pull-requests: write
steps:
- name: checkout pushed PR
uses: actions/checkout@v5
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v47.0.5
- name: test individual shell tools
if: contains(steps.changed-files.outputs.all_changed_files, 'individual-shell-tools/awk/script-01.sh')
run: ./test-sdc.sh individual-shell-tools
shell: bash
- name: test jq
if: contains(steps.changed-files.outputs.all_changed_files, 'jq/script-01.sh')
run: ./test-sdc.sh jq
shell: bash
- name: test shell-pipelines
if: contains(steps.changed-files.outputs.all_changed_files, 'shell-pipelines/ls-grep/script-01.sh')
run: ./test-sdc.sh shell-pipelines
shell: bash
- name: make output comment
if: contains(steps.changed-files.outputs.all_changed_files, 'individual-shell-tools/awk/script-01.sh') || contains(steps.changed-files.outputs.all_changed_files, 'jq/script-01.sh') || contains(steps.changed-files.outputs.all_changed_files, 'shell-pipelines/ls-grep/script-01.sh')
env:
GH_TOKEN: ${{ secrets.MY_TOKEN }}
ISSUE_URL: ${{ github.event.issue.html_url }}
run: |
gh issue comment $ISSUE_URL --body-FILE testoutput.TXT
- name: read test output
if: contains(steps.changed-files.outputs.all_changed_files, 'individual-shell-tools/awk/script-01.sh') || contains(steps.changed-files.outputs.all_changed_files, 'jq/script-01.sh') || contains(steps.changed-files.outputs.all_changed_files, 'shell-pipelines/ls-grep/script-01.sh')
id: read-test-output
run: |
echo 'testoutput<<EOF' >> $GITHUB_OUTPUT
cat testoutput.txt >> $GITHUB_OUTPUT
echo EOF >> $GITHUB_OUTPUT
- name: add appropriate labels
if: contains(steps.read-test-output.outputs.testoutput, 'complete!')
env:
GH_TOKEN: ${{ secrets.MY_TOKEN }}
ISSUE_URL: ${{ github.event.issue.html_url }}
run: |
gh issue edit $ISSUE_URL --add-label "Complete"
gh issue edit $ISSUE_URL --remove-label "Needs Review"