From acd679abaf36c9bcb90fa65a1c7ae68e82e6738c Mon Sep 17 00:00:00 2001 From: wonderlandpark Date: Tue, 13 Apr 2021 14:37:23 +0900 Subject: [PATCH] ci: passing source branch env only at push --- .github/workflows/testing.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index fbfa5c8..8e996b0 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -1,5 +1,12 @@ name: CI -on: [push, pull_request] +on: + push: + branches: + - 'master' + - 'stable' + pull_request: + branches: + - '*' jobs: eslint: name: ESLint @@ -52,7 +59,6 @@ jobs: - name: Create needed files run: echo '{"tester":"DEMO_KEY"}' > secret.json - name: Build - if: success() && github.ref == 'refs/heads/master' run: yarn build env: NEXT_PUBLIC_SENTRY_SERVER_ROOT_DIR: ./api @@ -60,7 +66,7 @@ jobs: SENTRY_PROJECT: v2 SENTRY_DSN: ${{ secrets.SENTRY_DSN }} SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SOURCE_BRANCH: ${{ github.head_ref }} + SOURCE_BRANCH: ${{ github.event_name == 'push' && github.head_ref || null }} SOURCE_COMMIT: ${{ github.sha }} CI: true