cicd: move branch locality checking to the release workflow

This commit is contained in:
Andrew Hlynskyi 2023-05-20 01:52:31 +03:00
parent 30dc31ff53
commit 010f288b3c
2 changed files with 14 additions and 3 deletions

View file

@ -72,7 +72,7 @@ jobs:
name: Release
needs: [init, fast_checks, full_checks, min_version, build, sanitize]
if: >
github.event.pull_request.head.repo.full_name == github.repository &&
github.event_name == 'pull_request' &&
startsWith(github.head_ref, 'release/v') &&
!github.event.pull_request.draft
uses: ./.github/workflows/release.yml

View file

@ -12,10 +12,14 @@ jobs:
name: Check permissions
runs-on: ubuntu-latest
outputs:
release_allowed: ${{ steps.maintainer.outputs.is_maintainer == 'true' }}
release_allowed: >
${{
steps.maintainer.outputs.is_maintainer == 'true' &&
steps.local_branch.outputs.is_local == 'true'
}}
steps:
- name: Is maintainer
- name: Initated by a maintainer
id: maintainer
env:
GH_TOKEN: ${{ github.token }}
@ -31,6 +35,13 @@ jobs:
echo "is_maintainer=true" >> $GITHUB_OUTPUT
fi
- name: The ref branch is local
id: local_branch
env:
is_local: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
run: |
echo "is_local=${is_local}" >> $GITHUB_OUTPUT
release:
name: Release
needs: permissions