Skip to content

Commit

Permalink
cmd/konflux: do not fail if there is nothing to commit
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Demeester <[email protected]>
  • Loading branch information
vdemeester committed Sep 19, 2024
1 parent 75b20bc commit ee04f6d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/konflux/templates/github/workflows/update-sources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ jobs:
rm -rf upstream/.git
git add upstream head
if [[ -z $(git status --porcelain --untracked-files=no) ]]; then
echo "No change, exiting"
exit 0
fi
git commit -F- <<EOF
[bot] Update from {{.Upstream}} to ${NEW_COMMIT}
Expand All @@ -54,8 +59,6 @@ jobs:
git push -f origin actions/update/sources-{{.Branch}}
- name: Create pull request
run: |
if [ "$(gh pr list --base {{.Branch}} --head actions/update/sources-{{.Branch}} --json url --jq 'length')" = "0" ]; then
echo "creating PR..."
gh pr create -B {{.Branch}} -H actions/update/sources-{{.Branch}} --fill
Expand Down

0 comments on commit ee04f6d

Please sign in to comment.