Skip to content

Commit 3ff413e

Browse files
committed
refactor: simplify PR comment logic in check_pr_scope workflow
1 parent 8f14142 commit 3ff413e

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

.github/workflows/check_pr_scope.yml

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,10 @@ jobs:
5959
permissions:
6060
pull-requests: write
6161
steps:
62-
- name: Set comment body
63-
id: set_comment_body
64-
run: |
65-
{
66-
echo 'comment_body<<EOF'
67-
echo "PRのスコープが正しくありません。\n現在のスコープ: ${{ needs.check_scope.outputs.pr_scopes }}\n検知したスコープ: ${{ needs.check_scope.outputs.required_scopes }}"
68-
echo 'EOF'
69-
} >> $GITHUB_OUTPUT
70-
7162
- name: Comment on PR
72-
uses: actions/github-script@v7
63+
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
7364
with:
74-
github-token: ${{secrets.GITHUB_TOKEN}}
75-
script: |
76-
const body = `${{ steps.set_comment_body.outputs.comment_body }}`;
77-
github.rest.issues.createComment({
78-
issue_number: context.issue.number,
79-
owner: context.repo.owner,
80-
repo: context.repo.repo,
81-
body: body
82-
});
65+
message: |
66+
PRのスコープが正しくありません。
67+
現在のスコープ: ${{ needs.check_scope.outputs.pr_scopes }}
68+
検知したスコープ: ${{ needs.check_scope.outputs.required_scopes }}

0 commit comments

Comments
 (0)