Skip to content

Commit

Permalink
Commit changes only if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieuml committed Sep 6, 2023
1 parent 32715b4 commit d3ac50a
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/CI-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,20 @@ jobs:
run: cd react/ && npm install
- name: Build for production
run: cd react/ && npx webpack --env mode=production
- name: Commit bundles
- name: Commit bundles if necessary
run: |
git config user.name github-actions
git config user.email [email protected]
git add ./react/bundles
LAST_COMMIT=$(git log --format="%B" -n 1)
git commit -m "Build webpack bundles: $LAST_COMMIT"
git push
if [ -z $(git status --porcelain) ];
then
echo "Working directory clean. Nothing to commit."
else
echo "Working directory changed. Committing bundles."
git config user.name github-actions
git config user.email [email protected]
git add ./react/bundles
LAST_COMMIT=$(git log --format="%B" -n 1)
git commit -m "Build webpack bundles: $LAST_COMMIT"
git push
fi
test-prod:
needs: [lint-prod, build-webpack-prod]
runs-on: ubuntu-latest
Expand Down

0 comments on commit d3ac50a

Please sign in to comment.