Skip to content

Commit

Permalink
chore: Run release-plz on version changes only
Browse files Browse the repository at this point in the history
  • Loading branch information
bgins committed Mar 4, 2024
1 parent 8d73246 commit 4d86c2b
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/schemas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: 📄 Schemas

on:
push:
branches: [main, "release-plz-*"]
branches: [main, "bgins/run-schemas-*"]
# branches: [main, "release-plz-*"]
# branches: [main, "**"]

permissions:
Expand Down Expand Up @@ -68,9 +69,33 @@ jobs:
shell: bash
run: echo modified=$(if [[ $(git diff Cargo.toml) ]]; then echo "true"; else echo "false"; fi) >> $GITHUB_OUTPUT

- name: Push changes
if: ${{ steps.git-check-schemas.outputs.modified == 'true' || steps.git-check-manifest.outputs.modified == 'true' }}
- 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') }}
- name: Push changes to main
if: github.ref_name == 'main' && (steps.git-check-schemas.outputs.modified == 'true' || steps.git-check-manifest.outputs.modified == 'true')
run: |
echo RUNNING main
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
git commit -am "chore(schemas): update OpenRPC API doc and JSON schemas"
git push
- name: Push changes to release-plz branch
if: startsWith(github.ref_name, 'bgins/run-schemas') && steps.git-check-manifest.outputs.modified == 'true'
run: |
echo RUNNING release-plz
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
Expand Down

0 comments on commit 4d86c2b

Please sign in to comment.