Skip to content

Commit fe73cc5

Browse files
authored
ttt
1 parent ce3d8bd commit fe73cc5

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

.github/workflows/label-on-approval.yml

+11-17
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,15 @@ jobs:
3232
console.log('isApprovedByCollaborator:', isApprovedByCollaborator);
3333
console.log('pull_request:', pull_request.number);
3434
// Return the result to the workflow
35-
return { approvedByCollaborator: isApprovedByCollaborator, pullRequestNumber: pull_request.number };
35+
if (isApprovedByCollaborator) {
36+
await github.rest.issues.addLabels({
37+
owner,
38+
repo,
39+
issue_number: pull_request.number,
40+
labels: ['approved','auto merge']
41+
});
42+
}
43+
44+
45+
3646
37-
- name: Add label if approved by Collaborators
38-
if: ${{ steps.check_approval.outputs.approvedByCollaborator == true }}
39-
uses: actions/github-script@v7
40-
with:
41-
github-token: ${{ secrets.PAT_TOKEN }}
42-
script: |
43-
const { owner, repo } = context.repo;
44-
const { pullRequestNumber } = steps.check_approval.outputs;
45-
46-
// Add the label to the pull request
47-
await github.rest.issues.addLabels({
48-
owner,
49-
repo,
50-
issue_number: pullRequestNumber,
51-
labels: ['approved','auto merge']
52-
});

0 commit comments

Comments
 (0)