cicd: move branch locality checking to the release workflow
This commit is contained in:
parent
30dc31ff53
commit
010f288b3c
2 changed files with 14 additions and 3 deletions
2
.github/workflows/CICD.yml
vendored
2
.github/workflows/CICD.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
15
.github/workflows/release.yml
vendored
15
.github/workflows/release.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue