ci: passing source branch env only at push

This commit is contained in:
wonderlandpark 2021-04-13 14:37:23 +09:00
parent a20a8b18bd
commit acd679abaf
No known key found for this signature in database
GPG Key ID: E3E650B146478C64

View File

@ -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