|
1 | 1 | name: Test SDC Tasks |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
| 4 | + # push: |
| 5 | + # paths: |
| 6 | + # - 'individual-shell-tools/**.sh' |
| 7 | + # - 'shell-pipelines/**.sh' |
| 8 | + # - 'jq/*.sh' |
| 9 | + pull_request: |
5 | 10 | paths: |
6 | 11 | - 'individual-shell-tools/**.sh' |
7 | 12 | - 'shell-pipelines/**.sh' |
8 | 13 | - 'jq/*.sh' |
9 | | - pull_request_target: |
10 | | - types: |
11 | | - - labeled |
12 | | - - unlabeled |
13 | | - - opened |
14 | | - - edited |
15 | | - - reopened |
| 14 | + # pull_request_target: |
| 15 | + # types: |
| 16 | + # - labeled |
| 17 | + # - unlabeled |
| 18 | + # - opened |
| 19 | + # - edited |
| 20 | + # - reopened |
16 | 21 |
|
17 | 22 | jobs: |
18 | 23 | test_sdc_tasks: |
@@ -60,20 +65,36 @@ jobs: |
60 | 65 | echo 'testoutput<<EOF' >> $GITHUB_OUTPUT |
61 | 66 | cat testoutput.txt >> $GITHUB_OUTPUT |
62 | 67 | echo EOF >> $GITHUB_OUTPUT |
63 | | - - uses: actions/github-script@v7 |
64 | | - id: get_pr_data |
65 | | - with: |
66 | | - script: | |
67 | | - return ( |
68 | | - await github.rest.repos.listPullRequestsAssociatedWithCommit({ |
69 | | - commit_sha: context.sha, |
70 | | - owner: context.repo.owner, |
71 | | - repo: context.repo.repo, |
72 | | - }) |
73 | | - ).data[0]; |
| 68 | + # - uses: actions/github-script@v7 |
| 69 | + # id: get_pr_data |
| 70 | + # with: # this isn't going to work with a fork pr |
| 71 | + # script: | |
| 72 | + # return ( |
| 73 | + # await github.rest.repos.listPullRequestsAssociatedWithCommit({ |
| 74 | + # commit_sha: context.sha, |
| 75 | + # owner: context.repo.owner, |
| 76 | + # repo: context.repo.repo, |
| 77 | + # }) |
| 78 | + # ).data[0]; |
74 | 79 | - name: make output comment |
75 | 80 | uses: peter-evans/create-or-update-comment@v5.0.0 |
76 | 81 | with: |
77 | | - issue-number: ${{ fromJson(steps.get_pr_data.outputs.result).number }} # ${{ github.event.number }} |
| 82 | + issue-number: ${{ github.event.number }} # ${{ fromJson(steps.get_pr_data.outputs.result).number }} |
78 | 83 | body: ${{ steps.read-test-output.outputs.testoutput }} |
79 | | - |
| 84 | + - uses: actions/github-script@v7 |
| 85 | + id: update-labels |
| 86 | + if: contains(steps.read-test-output.outputs.testoutput, 'complete!') |
| 87 | + with: |
| 88 | + script: | |
| 89 | + await github.rest.issues.addLabels({ |
| 90 | + owner: context.repo.owner, |
| 91 | + repo: context.repo.repo, |
| 92 | + issue_number: ${{ github.event.number }}, |
| 93 | + labels: ["Complete"] |
| 94 | + }); |
| 95 | + await github.rest.issues.removeLabel({ |
| 96 | + owner: context.repo.owner, |
| 97 | + repo: context.repo.repo, |
| 98 | + issue_number: ${{ github.event.number }}, |
| 99 | + name: "Needs Review" |
| 100 | + }); |
0 commit comments