From f9bb12d2503e25951bc35f3320a91fef2ef439ef Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 13 Oct 2021 19:34:58 +0100 Subject: [PATCH] Only run workflow on pull request if it comes from a fork (push will already be running if it is an internal PR) Use softprops/action-gh-release to attach binaries to release. Signed-off-by: Adam Warner --- .github/workflows/build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a91bd811..ce5d0a90 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,6 +10,7 @@ on: jobs: define-shared-vars: + if: ${{ github.event_name == 'push' || github.event_name == 'release' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }} runs-on: ubuntu-latest outputs: GIT_TAG: ${{ steps.variables.outputs.GIT_TAG }} @@ -28,6 +29,7 @@ jobs: echo ::set-output name=OUTPUT_DIR::${GIT_TAG:-${GIT_BRANCH}} build-and-test-x86-32-64: + if: ${{ github.event_name == 'push' || github.event_name == 'release' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }} needs: define-shared-vars env: GIT_TAG: ${{ needs.define-shared-vars.outputs.GIT_TAG }} @@ -76,6 +78,7 @@ jobs: path: '${{ matrix.bin_name }}*' build-arm-aarch64: + if: ${{ github.event_name == 'push' || github.event_name == 'release' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }} needs: [ build-and-test-x86-32-64, define-shared-vars] env: GIT_TAG: ${{ needs.define-shared-vars.outputs.GIT_TAG }} @@ -150,8 +153,7 @@ jobs: - name: Attach binaries to release if: ${{ github.event_name == 'release' }} - uses: skx/github-action-publish-binaries@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v1 with: - args: '*' \ No newline at end of file + files: | + *