Skip to content

Commit

Permalink
fix: check if commit is needed (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickleet committed Oct 30, 2022
1 parent 3e5a88b commit 6a4bfcf
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,19 @@ jobs:
- name: Commit Preview Env Changes
run: |
cd previews
cat helm/templates/${{ github.event.repository.name }}-pr-${{ github.event.pull_request.number }}.yaml
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "promote: ${{ github.event.repository.name }}-pr-${{ github.event.pull_request.number }} ${{ github.sha }}"
if output=$(git status --porcelain) && [ -z "$output" ]; then
# Working directory clean
echo "No changes to commit"
else
# Uncommitted changes
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -A
git commit -m "promote: ${{ github.event.repository.name }}-pr-${{ github.event.pull_request.number }} ${{ github.sha }}"
fi
- name: Push Preview Env Changes
uses: ad-m/github-push-action@master
Expand Down

0 comments on commit 6a4bfcf

Please sign in to comment.