Browse Source

feat(workflows): disable forks to run release-pr

tmp solution for #3527
pull/4043/head
Wing-Kam Wong 2 years ago
parent
commit
00425260b3
  1. 12
      .github/workflows/release-pr.yml

12
.github/workflows/release-pr.yml

@ -15,7 +15,7 @@ on:
jobs: jobs:
# enrich tag for pr release # enrich tag for pr release
set-tag: set-tag:
if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' }} if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' }}
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'
steps: steps:
- name: set-tag - name: set-tag
@ -42,7 +42,7 @@ jobs:
# Build, install, publish frontend and backend to npm # Build, install, publish frontend and backend to npm
release-npm: release-npm:
if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' }} if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' }}
needs: [set-tag] needs: [set-tag]
uses: ./.github/workflows/release-npm.yml uses: ./.github/workflows/release-npm.yml
with: with:
@ -53,7 +53,7 @@ jobs:
# Build docker image and push to docker hub # Build docker image and push to docker hub
release-docker: release-docker:
if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' }} if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' }}
needs: [release-npm, set-tag] needs: [release-npm, set-tag]
uses: ./.github/workflows/release-docker.yml uses: ./.github/workflows/release-docker.yml
with: with:
@ -67,7 +67,7 @@ jobs:
# Build executables and publish to GitHub # Build executables and publish to GitHub
release-executables: release-executables:
if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' }} if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' }}
needs: [set-tag, release-npm] needs: [set-tag, release-npm]
uses: ./.github/workflows/release-timely-executables.yml uses: ./.github/workflows/release-timely-executables.yml
with: with:
@ -77,7 +77,7 @@ jobs:
# Add a comment for PR docker build # Add a comment for PR docker build
leave-comment: leave-comment:
if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' }} if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' }}
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'
needs: [release-docker, set-tag] needs: [release-docker, set-tag]
steps: steps:
@ -91,7 +91,7 @@ jobs:
# Add a comment for PR executable build # Add a comment for PR executable build
leave-executable-comment: leave-executable-comment:
if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' }} if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' }}
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'
needs: [release-executables, set-tag] needs: [release-executables, set-tag]
steps: steps:

Loading…
Cancel
Save