Skip to content

Commit

Permalink
workflow conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro100 committed Apr 10, 2024
1 parent f788ae0 commit eb39cf0
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/publish_validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
- fix/publish-workflow

jobs:
build-and-publish:
check-versions:
name: check-version-job
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -32,11 +33,22 @@ jobs:
run: |
if [ "$CURRENT_VERSION" != "$LOCAL_VERSION" ]; then
echo "Version changed from $CURRENT_VERSION to $LOCAL_VERSION"
echo "VERSION_CHANGED=true >> $GITHUB_OUTPUT
else
echo "Version did not change"
exit 0
echo "VERSION_CHANGED=false >> $GITHUB_OUTPUT
fi
build-publish:
name: build-publish-job
needs: [check-versions]
if: needs.check-versions.outputs.VERSION_CHANGED == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./gbfs-validator

steps:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
Expand Down

0 comments on commit eb39cf0

Please sign in to comment.