diff --git a/.github/workflows/update-sources.main.yaml b/.github/workflows/update-sources.main.yaml index d99e0f69af..724963b09a 100644 --- a/.github/workflows/update-sources.main.yaml +++ b/.github/workflows/update-sources.main.yaml @@ -35,14 +35,24 @@ jobs: sed -i "s%go 1.22.*%go 1.22%g" go.mod sed -i "s%go 1.22.*%go 1.22%g" vendor/modules.txt - git diff > ../.konflux/patches/0000-go1.22.patch + if [[ -z $(git status --porcelain --untracked-files=no) ]]; then + echo "No change, exiting" + exit 0 + else + git diff > ../.konflux/patches/0000-go1.22.patch + fi # clean after yourself >:D git checkout HEAD go.mod vendor/modules.txt sed -i "s%go 1.23.*%go 1.22%g" go.mod sed -i "s%go 1.23.*%go 1.22%g" vendor/modules.txt - git diff > ../.konflux/patches/0000-go1.23.patch + if [[ -z $(git status --porcelain --untracked-files=no) ]]; then + echo "No change, exiting" + exit 0 + else + git diff > ../.konflux/patches/0000-go1.23.patch + fi # clean after yourself >:D git checkout HEAD go.mod vendor/modules.txt diff --git a/.github/workflows/update-sources.next.yaml b/.github/workflows/update-sources.next.yaml index 831499a080..23fc780228 100644 --- a/.github/workflows/update-sources.next.yaml +++ b/.github/workflows/update-sources.next.yaml @@ -35,14 +35,24 @@ jobs: sed -i "s%go 1.22.*%go 1.22%g" go.mod sed -i "s%go 1.22.*%go 1.22%g" vendor/modules.txt - git diff > ../.konflux/patches/0000-go1.22.patch + if [[ -z $(git status --porcelain --untracked-files=no) ]]; then + echo "No change, exiting" + exit 0 + else + git diff > ../.konflux/patches/0000-go1.22.patch + fi # clean after yourself >:D git checkout HEAD go.mod vendor/modules.txt sed -i "s%go 1.23.*%go 1.22%g" go.mod sed -i "s%go 1.23.*%go 1.22%g" vendor/modules.txt - git diff > ../.konflux/patches/0000-go1.23.patch + if [[ -z $(git status --porcelain --untracked-files=no) ]]; then + echo "No change, exiting" + exit 0 + else + git diff > ../.konflux/patches/0000-go1.23.patch + fi # clean after yourself >:D git checkout HEAD go.mod vendor/modules.txt