Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

continue-on-error not working as expected after changing from "docker" to "composite" action #417

Open
BertelBB opened this issue Oct 16, 2024 · 0 comments

Comments

@BertelBB
Copy link

From v0.25.0 to v0.26.0 the action that runs Trivy was changed from using: 'docker' to using: 'composite' and that broke our workflows in cases when steps.continue-on-error statement is executed with an input in the expression.

- name: Run Trivy
  continue-on-error: ${{ inputs.continue-on-error }} # <-- Workflow fails is this line is executed because "inputs" is null
  uses: aquasecurity/[email protected]

See change here: https://github.com/aquasecurity/trivy-action/compare/0.25.0..0.26.0#diff-fab4d7fb461bc6fbe9587f6c03fff98102b1c744145edcf2a993f2ff7cb05a0dL102

See issue explaining how inputs are not available in steps.continue-on-error when running as composite action: actions/runner#2418


Workaround

for those interested, there is a workaround using env context and fromJSON function

- name: Run Trivy
  env:
    CONTINUE_ON_ERROR: ${{ inputs.continue-on-error }}
  continue-on-error: ${{ fromJSON(env.CONTINUE_ON_ERROR) }}
  uses: aquasecurity/[email protected]
@BertelBB BertelBB changed the title Changing trivy from "docker" to "composite" action broke continue-on-error continue-on-error not working as expected after changing from "docker" to "composite" action Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant