Skip to content

Commit c4b439b

Browse files
committed
fix: enhance PR comment body handling in scope check workflow
This commit improves the GitHub Actions workflow for PR scope checks by: - Adding a step to set the comment body with detailed information about scope validation failures. - Updating the comment creation step to utilize the newly set comment body, ensuring accurate and informative feedback for PR authors. These changes aim to provide clearer communication regarding scope issues in pull requests.
1 parent 91a8e7d commit c4b439b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/check_pr_scope.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,17 @@ jobs:
4444
permissions:
4545
pull-requests: write
4646
steps:
47+
- name: Set comment body
48+
id: set_comment_body
49+
run: |
50+
echo "comment_body=PRのスコープが正しくありません。\nタイトル: ${{ needs.check_scope.outputs.title }}\n変更ファイル: ${{ needs.check_scope.outputs.files }}" >> $GITHUB_OUTPUT
51+
4752
- name: Comment on PR
4853
uses: actions/github-script@v7
4954
with:
5055
github-token: ${{secrets.GITHUB_TOKEN}}
5156
script: |
52-
const body = `${process.env.comment_body}`;
57+
const body = `${{ steps.set_comment_body.outputs.comment_body }}`;
5358
github.rest.issues.createComment({
5459
issue_number: context.issue.number,
5560
owner: context.repo.owner,

0 commit comments

Comments
 (0)