Github actions on pull request and master branch
I think you are just missing a colon after pull_request
. This works for me.
on:
pull_request:
push:
branches: master
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Test
run: echo "done"
Explanation
Each trigger has to be defined as a property that defines an object.
Each object defines overrides for default settings.
There are 3 possible syntax you can use:
Minimal syntax:
on:
pull_request:
push: { branches: [master] }
Explicit syntax:
on:
pull_request: {}
push: { branches: [master] }
Extendable syntax:
on:
pull_request:
push:
branches:
- master
When using a version control system the latter may be most useful as diff viewers can always easily distinguish* between different lines.
*Although modern diff viewers can also easily distinguish inline differences.