Skip to content

Commit

Permalink
publish.yml: don't crash when there are change files
Browse files Browse the repository at this point in the history
  • Loading branch information
Adjective-Object authored and Max Huang-Hobbs committed Nov 14, 2024
1 parent c2e8bf4 commit b8951c9
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,22 @@ jobs:
mkdir artifacts
cp *.node artifacts
yarn artifacts
- name: check changes
- name: Check changes
id: check_changes
run: |
git remote set-url origin https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git
# Generate changes from beachball, including package.json version bump
yarn beachball bump
# Check if that contains changefiles
git diff --exit-code -- ./change
echo "OUTPUT_STATUS=$?" >> "$GITHUB_OUTPUT"
if yarn beachball bump | grep "Removing change files:"; then
echo "changes!"
echo "HAS_CHANGES=true" >> "$GITHUB_OUTPUT"
else
echo "no changes!"
echo "HAS_CHANGES=false" >> "$GITHUB_OUTPUT"
fi
shell: bash
- name: Publish
if: ${{ steps.check_changes.outputs.OUTPUT_STATUS == 1 }}
if: ${{ steps.check_changes.outputs.HAS_CHANGES == 'true' }}
run: |
git config user.email "mhuan13@gmail.com"
git config user.name "$GITHUB_ACTOR"
Expand Down

0 comments on commit b8951c9

Please sign in to comment.