FailFastUploadArtifact
¶
upload-artifact
should fail fast.
Defined by FailFastActionsRule
which supports workflows, actions in the "Default" ruleset along with FailFastPublishUnitTestResults
, FailFastPeterEvansCreatePullRequest
, FailFastSoftpropsGhRelease
.
Description¶
actions/upload-artifact
should be configured to fail the CI when no files are found.
When the action is not configured to fail on missing files, the action step will be successful even when the artifact is not uploaded.
There are no branch protection rules to ensure that an artifact is produced, so the only way to ensure that the workflows are correct, is by failing the action step when the artifact input files are missing.
See the if-no-files-found
input declaration.
In case you're certain this if acceptable behavior,
disable this by explicitly setting if-no-files-found: warn
or if-no-files-found: ignore
.
Compliant example¶
if-no-files-found
input is specified.
example.yml
on: push jobs: example: runs-on: ubuntu-latest steps: - uses: actions/upload-artifact@v4 with: if-no-files-found: error path: | build/some/report/
Non-compliant example¶
if-no-files-found
input is not declared, so it uses the default warn
value.
example.yml
on: push jobs: example: runs-on: ubuntu-latest steps: - uses: actions/upload-artifact@v4 with: path: | build/some/report/
- Line 6: Step[actions/upload-artifact@v4] in Job[example] should have input
if-no-files-found: error
.