Skip to content

Commit

Permalink
Merge pull request #57 from jitsecurity-controls/sc-22033-support-no-…
Browse files Browse the repository at this point in the history
…failure-if-cannot-checkout

Jit GitHub Action shouldn't always fail if cannot checkout the code [sc-22033]
  • Loading branch information
agmond committed Dec 11, 2023
2 parents e4633e9 + c5ff790 commit 2b520e1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ inputs:
description: "fail control when finding is found"
required: false
default: "true"
fail_if_cannot_checkout:
description: "fail control if cannot checkout original repo"
required: false
default: "true"
inline_environment:
description: "inline environment variables to be passed to the container"
required: false
Expand Down Expand Up @@ -120,7 +124,7 @@ runs:

- name: Exit if checkout failure is fatal
shell: bash
if: steps.checkout-original-repo.outcome == 'failure' && fromJSON(github.event.inputs.client_payload).payload.workflow_job_name != 'enrich'
if: steps.checkout-original-repo.outcome == 'failure' && fromJSON(github.event.inputs.client_payload).payload.workflow_job_name != 'enrich' && inputs.fail_if_cannot_checkout == 'true'
run: |
echo "(error) Original repo checkout failed, can't continue job execution"
exit 102
Expand Down

0 comments on commit 2b520e1

Please sign in to comment.