Skip to content

Commit 960ec18

Browse files
fix: clean up version-bump workflow script output handling (#153)
## Description Removed unnecessary comments and added commands to reset the working directory and clean untracked files in the version-bump workflow. This improves the script's reliability by ensuring a clean state after executing version checks. --- ## Type of Change - [ ] New module - [X] Bug fix - [ ] Feature/enhancement - [ ] Documentation - [ ] Other --- ## Related Issues None
1 parent eae6416 commit 960ec18

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/version-bump.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ jobs:
4747
- name: Check version bump requirements
4848
id: version-check
4949
run: |
50-
# Run the script to check what versions should be
5150
output_file=$(mktemp)
5251
if ./.github/scripts/version-bump.sh "${{ steps.bump-type.outputs.type }}" origin/main > "$output_file" 2>&1; then
5352
echo "Script completed successfully"
@@ -57,17 +56,14 @@ jobs:
5756
exit 1
5857
fi
5958
60-
# Store output for PR comment
6159
{
6260
echo "output<<EOF"
6361
cat "$output_file"
6462
echo "EOF"
6563
} >> $GITHUB_OUTPUT
6664
67-
# Show output
6865
cat "$output_file"
6966
70-
# Check if any files would be modified by the script
7167
if git diff --quiet; then
7268
echo "versions_up_to_date=true" >> $GITHUB_OUTPUT
7369
echo "✅ All module versions are already up to date"
@@ -79,13 +75,18 @@ jobs:
7975
echo ""
8076
echo "Diff preview:"
8177
git diff
78+
79+
git checkout .
80+
git clean -fd
81+
8282
exit 1
8383
fi
8484
8585
- name: Comment on PR - Failure
8686
if: failure() && steps.version-check.outputs.versions_up_to_date == 'false'
8787
uses: actions/github-script@v7
8888
with:
89+
github-token: ${{ secrets.GITHUB_TOKEN }}
8990
script: |
9091
const output = `${{ steps.version-check.outputs.output }}`;
9192
const bumpType = `${{ steps.bump-type.outputs.type }}`;

0 commit comments

Comments
 (0)