Skip to content

Try this

Try this #17

Workflow file for this run

on:
pull_request:
types: [opened, edited, synchronize, reopened]
# For Draft PRs, we only want the herpaderp step 1
# For Non-Draft PRs, we want all the steps
jobs:
mootrix:
runs-on: ${{ matrix.os }}
name: Mootrix ${{ matrix.os }} - ${{ matrix.config.moo }}
strategy:
matrix:
os: [ macOS-11, ubuntu-latest ]
config:
- {"moo": "boo"}
- {"moo": "blergh"}
include:
- os: ubuntu-20.04
config:
moo: "herpaderp"
steps:
- name: ${{ matrix.config.moo }} should only run for herpaderp on draft
if: ${{ github.event.pull_request.draft == true && matrix.config.moo == 'herpaderp' }}
run: |
echo "Doing the thing"
sleep 5
echo "The thing is done"
- name: Always run
run: |
echo "This thing always happens"
sleep 5
echo "And has now been concluded"
meowtrix:
runs-on: ${{ matrix.os }}
name: Meowtrix ${{ matrix.os }} - ${{ matrix.config.moo }}
if: "${{ (! github.event.pull_request.draft) || (matrix.config.moo == 'boo')}}"

Check failure on line 39 in .github/workflows/waste_time.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/waste_time.yaml

Invalid workflow file

The workflow is not valid. .github/workflows/waste_time.yaml (Line: 39, Col: 9): Unrecognized named-value: 'matrix'. Located at position 41 within expression: (! github.event.pull_request.draft) || (matrix.config.moo == 'boo')
strategy:
matrix:
os: [ macOS-11, ubuntu-latest ]
config:
- {"moo": "boo"}
- {"moo": "blergh"}
include:
- os: ubuntu-20.04
config:
moo: "herpaderp"
steps:
- name: First step
run: |
echo "Doing the thing"
sleep 5
echo "The thing is done"
- name: Second step
run: |
echo "Doing the other thing"
sleep 5
echo "The other thing is also done"