Skip to content

Commit

Permalink
LINBEE-9076 - fix condition (#112)
Browse files Browse the repository at this point in the history
* LINBEE-9076 - fix condition

* debug

* debug

* debug

* debug

* debug

* fix

* remove log

* format

---------

Co-authored-by: Yeela Lifshitz <yeelalifshitz@Yeela-MacBook-Pro.local>
  • Loading branch information
yeelali14 and Yeela Lifshitz authored Aug 18, 2024
1 parent e56a977 commit 158c32b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ runs:
- name: Get condition variables
uses: actions/github-script@v7
env:
CLIENT_PAYLOAD_ARG: ${{ inputs.client_payload }}
IS_NON_COMMIT_ARG: ${{ fromJSON(fromJSON(inputs.client_payload)).isNonCommitEvent }}
ENABLE_CACHE_ARG: ${{ env.ENABLE_CACHE }}
with:
script: |
Expand Down
11 changes: 6 additions & 5 deletions scripts/get-condition-vars.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/* eslint-disable import/no-commonjs */

module.exports = core => {
const { CLIENT_PAYLOAD_ARG, ENABLE_CACHE_ARG } = process.env
const { IS_NON_COMMIT_ARG, ENABLE_CACHE_ARG } = process.env
try {
const payload = JSON.parse(CLIENT_PAYLOAD_ARG)
const isNonCommitEvent = payload.isNonCommitEvent === true
const skipGitClone = isNonCommitEvent && ENABLE_CACHE_ARG === 'true'
core.exportVariable('IS_NON_COMMIT_EVENT', isNonCommitEvent.toString())
const skipGitClone =
IS_NON_COMMIT_ARG === 'true' && ENABLE_CACHE_ARG === 'true'

core.exportVariable('IS_NON_COMMIT_EVENT', IS_NON_COMMIT_ARG)
core.exportVariable('SKIP_GIT_CLONE', skipGitClone.toString())
} catch (error) {
core.setFailed(error.message)

core.exportVariable('IS_NON_COMMIT_EVENT', 'false')
core.exportVariable('SKIP_GIT_CLONE', 'false')
}
Expand Down

0 comments on commit 158c32b

Please sign in to comment.