Skip to content

Commit c5b4313

Browse files
committed
github actions: Convert github-script usage to gh
This keeps all of our PR interaction consistent
1 parent 3cc867c commit c5b4313

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

.github/workflows/validate-kernel-commits.yml

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -145,34 +145,22 @@ jobs:
145145
146146
- name: Comment PR with JIRA issues
147147
if: steps.jira_check.outputs.has_issues == 'true'
148-
uses: actions/github-script@v7
149-
with:
150-
github-token: ${{ secrets.GITHUB_TOKEN }}
151-
script: |
152-
const output = process.env.CHECK_OUTPUT;
153-
154-
github.rest.issues.createComment({
155-
issue_number: context.issue.number,
156-
owner: context.repo.owner,
157-
repo: context.repo.repo,
158-
body: output
159-
});
160148
env:
161-
CHECK_OUTPUT: ${{ steps.jira_check.outputs.output }}
149+
GH_TOKEN: ${{ github.token }}
150+
run: |
151+
gh pr comment ${{ github.event.pull_request.number }} \
152+
--body "${{ steps.jira_check.outputs.output }}" \
153+
--repo ${{ github.repository }}
162154
163155
- name: Request changes if LTS mismatch
164156
if: steps.jira_check.outputs.has_lts_mismatch == 'true'
165-
uses: actions/github-script@v7
166-
with:
167-
github-token: ${{ secrets.GITHUB_TOKEN }}
168-
script: |
169-
github.rest.pulls.createReview({
170-
owner: context.repo.owner,
171-
repo: context.repo.repo,
172-
pull_number: context.issue.number,
173-
event: 'REQUEST_CHANGES',
174-
body: '⚠️ This PR contains VULN tickets that do not match the target LTS product. Please review the JIRA ticket assignments and ensure they match the merge target branch.'
175-
});
157+
env:
158+
GH_TOKEN: ${{ github.token }}
159+
run: |
160+
gh pr review ${{ github.event.pull_request.number }} \
161+
--request-changes \
162+
--body "⚠️ This PR contains VULN tickets that do not match the target LTS product. Please review the JIRA ticket assignments and ensure they match the merge target branch." \
163+
--repo ${{ github.repository }}
176164
177165
- name: Fail workflow if JIRA errors found
178166
if: steps.jira_check.outcome == 'failure'

0 commit comments

Comments
 (0)