Skip to content

Commit 05c1ae1

Browse files
author
l
committed
use gh cli instead of template action
1 parent d2bebe3 commit 05c1ae1

File tree

1 file changed

+14
-23
lines changed

1 file changed

+14
-23
lines changed

.github/workflows/test-sdc-tasks.yml

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
- 'jq/*.sh'
99
types:
1010
- labeled
11-
- unlabeled
1211
- opened
1312
- edited
1413
- reopened
@@ -39,33 +38,25 @@ jobs:
3938
if: contains(steps.changed-files.outputs.all_changed_files, 'shell-pipelines/ls-grep/script-01.sh')
4039
run: ./test-sdc.sh shell-pipelines
4140
shell: bash
41+
- name: make output comment
42+
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')
43+
env:
44+
GH_TOKEN: ${{ secrets.MY_TOKEN }}
45+
ISSUE_URL: ${{ github.event.issue.html_url }}
46+
run: |
47+
gh issue comment $ISSUE_URL --body-FILE testoutput.TXT
4248
- name: read test output
4349
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')
4450
id: read-test-output
4551
run: |
4652
echo 'testoutput<<EOF' >> $GITHUB_OUTPUT
4753
cat testoutput.txt >> $GITHUB_OUTPUT
4854
echo EOF >> $GITHUB_OUTPUT
49-
50-
- name: make output comment
51-
uses: peter-evans/create-or-update-comment@v5.0.0
52-
with:
53-
issue-number: ${{ github.event.number }}
54-
body: ${{ steps.read-test-output.outputs.testoutput }}
55-
- uses: actions/github-script@v7
56-
id: update-labels
55+
- name: add appropriate labels
5756
if: contains(steps.read-test-output.outputs.testoutput, 'complete!')
58-
with:
59-
script: |
60-
await github.rest.issues.addLabels({
61-
owner: context.repo.owner,
62-
repo: context.repo.repo,
63-
issue_number: ${{ github.event.number }},
64-
labels: ["Complete"]
65-
});
66-
await github.rest.issues.removeLabel({
67-
owner: context.repo.owner,
68-
repo: context.repo.repo,
69-
issue_number: ${{ github.event.number }},
70-
name: "Needs Review"
71-
});
57+
env:
58+
GH_TOKEN: ${{ secrets.MY_TOKEN }}
59+
ISSUE_URL: ${{ github.event.issue.html_url }}
60+
run: |
61+
gh issue edit $ISSUE_URL --add-label "Complete"
62+
gh issue edit $ISSUE_URL --remove-label "Needs Review"

0 commit comments

Comments
 (0)