diff --git a/.github/workflows/helm-release.yaml b/.github/workflows/helm-release.yaml index f270251a..8c8b0b3e 100644 --- a/.github/workflows/helm-release.yaml +++ b/.github/workflows/helm-release.yaml @@ -22,19 +22,22 @@ jobs: run: | make helm-schema - - name: Branch + - name: Git diff + id: git-diff + run: | + git diff --exit-code + if [ $? -eq 0 ]; then + echo "::set-output name=changes::false" + else + echo "::set-output name=changes::true" + fi + + - name: "Commit changes and make PR" + if: steps.git-diff.outputs.changes == 'true' run: | git checkout -b helm/schema-update git add charts/k6-operator/values.schema.json - git diff --cached | tee diff.file - echo "WC_DIFF=$(wc -c < diff.file)" >> "$GITHUB_OUTPUT" - wc -c < diff.file - cat diff.file - - name: "Make PR" - if: ${{ steps.branch.WC_DIFF }} > 0 - run: | - echo "diff ${{ steps.branch.WC_DIFF }}" git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com"