Skip to content

Commit

Permalink
Only on default branch
Browse files Browse the repository at this point in the history
  • Loading branch information
nhuet committed Oct 11, 2022
1 parent 7ad33c8 commit 822fb4b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@ concurrency:
cancel-in-progress: true

jobs:
job_only_on_default1:
runs-on: ubuntu-latest
if: $${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
steps:
- run: echo should work only on default
job_only_on_default2:
runs-on: ubuntu-latest
if: ${{ github.ref }} == refs/heads/${{ github.event.repository.default_branch }}
steps:
- run: echo should work only on default 2
job_only_on_default3:
runs-on: ubuntu-latest
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
steps:
- run: echo should work only on default

test:
runs-on: windows-2022
defaults:
Expand Down

0 comments on commit 822fb4b

Please sign in to comment.