From 17b27c6efec21252310099fdb825c33323cb5b12 Mon Sep 17 00:00:00 2001 From: Brian Ginsburg Date: Mon, 4 Mar 2024 13:33:14 -0800 Subject: [PATCH] chore: Run release-plz on version changes only --- .github/workflows/schemas.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/schemas.yml b/.github/workflows/schemas.yml index 8f3e48dd..ebe46f0d 100644 --- a/.github/workflows/schemas.yml +++ b/.github/workflows/schemas.yml @@ -2,7 +2,8 @@ name: 📄 Schemas on: push: - branches: [main, "release-plz-*"] + branches: [main, "bgins/run-schemas-*"] + # branches: [main, "release-plz-*"] # branches: [main, "**"] permissions: @@ -68,9 +69,25 @@ jobs: shell: bash run: echo modified=$(if [[ $(git diff Cargo.toml) ]]; then echo "true"; else echo "false"; fi) >> $GITHUB_OUTPUT + - name: Echo results + run: | + echo Manifest version updated: + echo ${{ steps.git-check-manifest.outputs.modified }} + echo Schemas updated: + echo ${{ steps.git-check-schemas.outputs.modified }} + echo Branch starts with bgins/run-schemas: + echo ${{ startsWith(github.ref_name, 'bgins/run-schemas') }} + echo Check main condition: + echo ${{ (github.ref_name == 'main' && (steps.git-check-schemas.outputs.modified == 'true' || steps.git-check-manifest.outputs.modified == 'true')) }} + echo Check branch condition: + echo ${{ (startsWith(github.ref_name, 'bgins/run-schemas') && steps.git-check-manifest.outputs.modified == 'true') }} + echo Check entire condition: + echo ${{ (github.ref_name == 'main' && (steps.git-check-schemas.outputs.modified == 'true' || steps.git-check-manifest.outputs.modified == 'true')) || (startsWith(github.ref_name, 'bgins/run-schemas') && steps.git-check-manifest.outputs.modified == 'true') }} + - name: Push changes - if: ${{ steps.git-check-schemas.outputs.modified == 'true' || steps.git-check-manifest.outputs.modified == 'true' }} + if: (github.ref_name == 'main' && (steps.git-check-schemas.outputs.modified == 'true' || steps.git-check-manifest.outputs.modified == 'true')) || (startsWith(github.ref_name, 'bgins/run-schemas') && steps.git-check-manifest.outputs.modified == 'true') run: | + echo RUNNING git config user.name "${GITHUB_ACTOR}" git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git