Skip to content

Commit

Permalink
Pre-process files list for conditional steps
Browse files Browse the repository at this point in the history
Change-type: minor
Signed-off-by: Kyle Harding <kyle@balena.io>
  • Loading branch information
klutchell committed Apr 5, 2024
1 parent 5c71769 commit 6e758b2
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/flowzone.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions flowzone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1209,13 +1209,31 @@ jobs:
# disable shellcheck for now
args: -color -shellcheck=

process_files:
name: Process files
runs-on: ${{ fromJSON(inputs.runs_on) }}
timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }}

<<: *customWorkingDirectory

outputs:
json: ${{ steps.process_files.outputs.json }}

steps:
- name: Generate file list json
id: process_files
run: |
echo "json=$(git ls-files | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
# check if the repository has a package.json file and which engine versions are supported
is_npm:
name: Is npm
runs-on: ${{ fromJSON(inputs.runs_on) }}
timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }}
needs:
- versioned_source
- process_files
if: contains(fromJSON(needs.process_files.outputs.json), 'package.json')

<<: *customWorkingDirectory

Expand Down

0 comments on commit 6e758b2

Please sign in to comment.