Skip to content

Commit f5f5157

Browse files
committed
changed third party job in action to github native
1 parent 4ab729e commit f5f5157

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

.github/workflows/api-report-approval.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99
- '**/*api_changes_report.md'
1010

1111
jobs:
12-
require-approval:
13-
name: Require Additional Approval for API Changes
12+
label-api-changes:
13+
name: Label API Changes
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout code
@@ -31,10 +31,28 @@ jobs:
3131
echo "No API changes detected."
3232
fi
3333
34-
- name: Require additional approval
34+
- name: Add API changes label
3535
if: env.API_CHANGES_DETECTED == 'true'
36-
uses: pulsar-edit/[email protected]
36+
uses: actions/github-script@v6
3737
with:
38-
token: ${{ secrets.GITHUB_TOKEN }}
39-
reviewers: 2
40-
message: "⚠️ This PR contains API changes and requires additional approval. Please review the API changes carefully."
38+
github-token: ${{ secrets.GITHUB_TOKEN }}
39+
script: |
40+
github.rest.issues.addLabels({
41+
issue_number: context.issue.number,
42+
owner: context.repo.owner,
43+
repo: context.repo.repo,
44+
labels: ['api-changes']
45+
})
46+
47+
- name: Comment on PR
48+
if: env.API_CHANGES_DETECTED == 'true'
49+
uses: actions/github-script@v6
50+
with:
51+
github-token: ${{ secrets.GITHUB_TOKEN }}
52+
script: |
53+
github.rest.issues.createComment({
54+
issue_number: context.issue.number,
55+
owner: context.repo.owner,
56+
repo: context.repo.repo,
57+
body: '⚠️ This PR contains API changes and requires careful review. Please ensure these changes are intentional and backward compatible where possible.'
58+
})

0 commit comments

Comments
 (0)