Skip to content

Commit

Permalink
fix(.github): fix actionsflow workflow
Browse files Browse the repository at this point in the history
Since the recent release of act, it now fails when there are no workflow files
to execute. In particular because of this PR:
nektos/act#2272. With this fix, we now only run act
when the workflow files were generated by actionsflow.
  • Loading branch information
qlonik committed Jun 10, 2024
1 parent 46556eb commit b25ecca
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/actionsflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,19 @@ jobs:
json-secrets: ${{ toJSON(secrets) }}
json-github: ${{ toJSON(github) }}

- name: Check workflow files
id: check-workflow-files
run: |-
if [[ -d "./dist/workflows" && ! -z "$(ls -A ./dist/workflows)" ]]; then
echo "present=true" >> "$GITHUB_OUTPUT"
fi
- name: Install act
if: ${{ steps.check-workflow-files.outputs.present == 'true' }}
run: curl -fsSL https://raw.githubusercontent.com/nektos/act/master/install.sh | bash -s -- -b ~/bin/

- name: Run act
if: ${{ steps.check-workflow-files.outputs.present == 'true' }}
# Consider adding support for cache artifacts
# https://github.com/nektos/act/issues/329#issuecomment-1187246629
# With this, cache action can be used in actionsflow workflows, caught by act
Expand Down

0 comments on commit b25ecca

Please sign in to comment.