Skip to content

Commit

Permalink
Try skipping step instead of job for non-PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ringler committed Nov 23, 2023
1 parent e2e9fa4 commit c31ee9b
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/subproject-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,26 @@ permissions:

on:
workflow_call:
inputs:
event_name:
required: true
type: string
outputs:
czishrink:
description: "true if the change affects czishrink or if event_name is not 'pull_request'; false otherwise"
value: ${{ inputs.event_name != 'pull_request' || jobs.changes.outputs.czishrink == 'true' }}
value: ${{ jobs.changes.outputs.czishrink }}
czicompress:
description: "true if the change affects czicompress or if event_name is not 'pull_request'; false otherwise"
value: ${{ inputs.event_name != 'pull_request' || jobs.changes.outputs.czishrink == 'true' }}
value: ${{ jobs.changes.outputs.czishrink }}

jobs:
# JOB to run change detection
changes:
if: ${{ inputs.event_name == 'pull_request' }}
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
czishrink: ${{ steps.filter.outputs.czishrink }}
czicompress: ${{ steps.filter.outputs.czicompress }}
czishrink: ${{ github.event_name != 'pull_request' || steps.filter.outputs.czishrink == 'true' }}
czicompress: ${{ github.event_name != 'pull_request' || steps.filter.outputs.czicompress == 'true' }}
steps:
- run: echo ${{ github.event_name }}
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
if: ${{ github.event_name == 'pull_request' }}
id: filter
with:
filters: |
Expand Down

0 comments on commit c31ee9b

Please sign in to comment.