Skip to content

Commit aae6eb6

Browse files
committed
fix: update PR scope output handling in workflow and script
This commit enhances the GitHub Actions workflow and the associated script for PR scope checks by: - Modifying the workflow to output `pr_scopes` instead of the PR title, providing more relevant information for scope validation. - Adding the `pr_scopes` output to the `GITHUB_OUTPUT` in the script, ensuring it is available for subsequent steps. These changes aim to improve the clarity and accuracy of the feedback provided to PR authors regarding scope validation issues.
1 parent 32208f7 commit aae6eb6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/check_pr_scope.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
outputs:
1111
outcome: ${{ steps.check_scope_step.outcome }}
12-
title: ${{ steps.pr_title.outputs.title }}
12+
pr_scopes: ${{ steps.check_scope_step.outputs.pr_scopes }}
1313
files: ${{ steps.changed_files.outputs.files }}
1414
required_scopes: ${{ steps.check_scope_step.outputs.required_scopes }}
1515
steps:
@@ -64,7 +64,7 @@ jobs:
6464
run: |
6565
{
6666
echo 'comment_body<<EOF'
67-
echo "PRのスコープが正しくありません。\n現在のスコープ: ${{ needs.check_scope.outputs.title }}\n検知したスコープ: ${{ needs.check_scope.outputs.required_scopes }}"
67+
echo "PRのスコープが正しくありません。\n現在のスコープ: ${{ needs.check_scope.outputs.pr_scopes }}\n検知したスコープ: ${{ needs.check_scope.outputs.required_scopes }}"
6868
echo 'EOF'
6969
} >> $GITHUB_OUTPUT
7070

scripts/check_pr_scope.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ echo "Required Scopes based on changed files: ${required_scopes[*]}"
8484
# Output required_scopes for GitHub Actions output
8585
if [ -n "${GITHUB_OUTPUT:-}" ]; then
8686
echo "required_scopes=${required_scopes[*]}" >> "$GITHUB_OUTPUT"
87+
echo "pr_scopes=${pr_scopes[*]}" >> "$GITHUB_OUTPUT"
8788
fi
8889

8990
if [[ ${pr_scopes[*]} =~ \* ]]; then

0 commit comments

Comments
 (0)