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
This commit is contained in:
parent
eae64160bd
commit
960ec18d35
9
.github/workflows/version-bump.yaml
vendored
9
.github/workflows/version-bump.yaml
vendored
@ -47,7 +47,6 @@ jobs:
|
|||||||
- name: Check version bump requirements
|
- name: Check version bump requirements
|
||||||
id: version-check
|
id: version-check
|
||||||
run: |
|
run: |
|
||||||
# Run the script to check what versions should be
|
|
||||||
output_file=$(mktemp)
|
output_file=$(mktemp)
|
||||||
if ./.github/scripts/version-bump.sh "${{ steps.bump-type.outputs.type }}" origin/main > "$output_file" 2>&1; then
|
if ./.github/scripts/version-bump.sh "${{ steps.bump-type.outputs.type }}" origin/main > "$output_file" 2>&1; then
|
||||||
echo "Script completed successfully"
|
echo "Script completed successfully"
|
||||||
@ -57,17 +56,14 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Store output for PR comment
|
|
||||||
{
|
{
|
||||||
echo "output<<EOF"
|
echo "output<<EOF"
|
||||||
cat "$output_file"
|
cat "$output_file"
|
||||||
echo "EOF"
|
echo "EOF"
|
||||||
} >> $GITHUB_OUTPUT
|
} >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
# Show output
|
|
||||||
cat "$output_file"
|
cat "$output_file"
|
||||||
|
|
||||||
# Check if any files would be modified by the script
|
|
||||||
if git diff --quiet; then
|
if git diff --quiet; then
|
||||||
echo "versions_up_to_date=true" >> $GITHUB_OUTPUT
|
echo "versions_up_to_date=true" >> $GITHUB_OUTPUT
|
||||||
echo "✅ All module versions are already up to date"
|
echo "✅ All module versions are already up to date"
|
||||||
@ -79,6 +75,10 @@ jobs:
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Diff preview:"
|
echo "Diff preview:"
|
||||||
git diff
|
git diff
|
||||||
|
|
||||||
|
git checkout .
|
||||||
|
git clean -fd
|
||||||
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -86,6 +86,7 @@ jobs:
|
|||||||
if: failure() && steps.version-check.outputs.versions_up_to_date == 'false'
|
if: failure() && steps.version-check.outputs.versions_up_to_date == 'false'
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
const output = `${{ steps.version-check.outputs.output }}`;
|
const output = `${{ steps.version-check.outputs.output }}`;
|
||||||
const bumpType = `${{ steps.bump-type.outputs.type }}`;
|
const bumpType = `${{ steps.bump-type.outputs.type }}`;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user