refactor(ci): refine checks workflow
We want to checkout not only for the default branch but also for any
release (NNN.NNN.x) branch as well.
@@ -11,13 +11,16 @@ jobs:
runs-on: ubuntu-latest
outputs:
is_default_branch: ${{ steps['info']['outputs']['is-default-branch'] }}
+ is_release_branch: ${{ steps['info']['outputs']['is-release-branch'] }}
steps:
- name: Fetch repository information
id: info
run: |
DEFAULT_BRANCH=$(curl -s https://api.github.com/repos/syndesisio/syndesis |jq -r .default_branch)
IS_DEFAULT_BRANCH=$(test "refs/heads/${DEFAULT_BRANCH}" == "${GITHUB_REF}" && echo true || echo false)
+ IS_RELEASE_BRANCH=$(echo "${GITHUB_REF}" | grep -q -e '^[0-9]\+\.[0-9]\+\.x' && echo true || echo false)
echo "::set-output name=is-default-branch::${IS_DEFAULT_BRANCH}"
+ echo "::set-output name=is-release-branch::${IS_RELEASE_BRANCH}"
changes:
needs: setup
runs-on: ubuntu-latest
@@ -27,7 +30,7 @@ jobs:
ui: ${{ steps.filter.outputs.ui }}
steps:
- uses: actions/checkout@v2
- if: needs.setup.outputs.is_default_branch == 'true'
+ if: needs.setup.outputs.is_release_branch == 'true'
- uses: dorny/paths-filter@v2
id: filter
with:
