7979 process.exit(1);
8080 }
8181
82- - name : Get condition variables
83- uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
84- env :
85- IS_NON_COMMIT_ARG : ${{ fromJSON(fromJSON(inputs.client_payload)).isNonCommitEvent }}
86- ENABLE_CACHE_ARG : ${{ env.ENABLE_CACHE }}
87- RUN_ID_ARG : ${{ fromJSON(fromJSON(inputs.client_payload)).artifactRunId }}
88- CACHE_DOWNLOAD_FAILED_ARG : ${{ env.CACHE_DOWNLOAD_FAILED }}
89- with :
90- script : |
91- require('${{ github.action_path }}/scripts/get-condition-vars.js')(core);
92-
93- - name : Download cache artifact for cm repo
94- id : download-cache-for-cm-repo
95- uses : actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
96- if : ${{ env.SKIP_GIT_CLONE == 'true' && fromJSON(fromJSON(inputs.client_payload)).hasCmRepo == true }}
97- continue-on-error : true
98- with :
99- github-token : ${{ fromJSON(fromJSON(inputs.client_payload)).githubToken || github.token }}
100- repository : ' ${{ fromJSON(fromJSON(inputs.client_payload)).owner }}/${{ fromJSON(fromJSON(inputs.client_payload)).cmRepo }}'
101- run-id : ${{ fromJSON(fromJSON(inputs.client_payload)).artifactRunId }}
102- name : output
103- path : code/output
104-
105- - name : Download cache artifact when cmRepo is false
106- id : download-cache
107- uses : actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
108- if : ${{ env.SKIP_GIT_CLONE == 'true' && fromJSON(fromJSON(inputs.client_payload)).hasCmRepo == false}}
109- continue-on-error : true
110- with :
111- github-token : ${{ fromJSON(fromJSON(inputs.client_payload)).githubToken || github.token }}
112- repository : ${{ inputs.full_repository }}
113- run-id : ${{ fromJSON(fromJSON(inputs.client_payload)).artifactRunId }}
114- name : output
115- path : code/output
116-
117- - name : Check if download cache artifact failed
118- uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
119- env :
120- ARTIFACT_OUTCOME_ARG : ${{ steps.download-cache.outcome }}
121- ARTIFACT_OUTCOME_CM_REPO_ARG : ${{ steps.download-cache-for-cm-repo.outcome }}
122- with :
123- script : require('${{ github.action_path }}/scripts/check-cache-download-status')(core);
124-
12582 - name : Checkout Pull Request branches history
126- if : ${{ env.SHOULD_CHECKOUT == 'true' }}
12783 shell : bash
12884 run : |
12985 cd gitstream && cd repo
@@ -136,13 +92,12 @@ runs:
13692 git checkout $'${{ steps.safe-strings.outputs.head_ref }}'
13793
13894 - name : Create cm folder
139- if : ${{ env.SHOULD_CHECKOUT == 'true' }}
14095 shell : bash
14196 run : cd gitstream && mkdir cm
14297
14398 - name : Checkout cm repo
14499 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
145- if : ${{ fromJSON(fromJSON(inputs.client_payload)).hasCmRepo == true && env.SHOULD_CHECKOUT == 'true' }}
100+ if : ${{ fromJSON(fromJSON(inputs.client_payload)).hasCmRepo == true }}
146101 with :
147102 repository : ' ${{ fromJSON(fromJSON(inputs.client_payload)).owner }}/${{ fromJSON(fromJSON(inputs.client_payload)).cmRepo }}'
148103 ref : ${{ fromJSON(fromJSON(inputs.client_payload)).cmRepoRef }}
@@ -151,7 +106,7 @@ runs:
151106
152107 - name : Checkout cm org
153108 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
154- if : ${{ fromJSON(fromJSON(inputs.client_payload)).hasCmOrg == true && env.SHOULD_CHECKOUT == 'true' }}
109+ if : ${{ fromJSON(fromJSON(inputs.client_payload)).hasCmOrg == true }}
155110 with :
156111 repository : ' cm/cm'
157112 ref : ${{ fromJSON(fromJSON(inputs.client_payload)).cmOrgRef }}
@@ -177,13 +132,11 @@ runs:
177132 RULES_RESOLVER_URL : ${{ inputs.resolver_url }}
178133 RULES_RESOLVER_TOKEN : ${{ inputs.resolver_token }}
179134 DEBUG_MODE : ${{ inputs.debug_mode }}
180- SHOULD_SKIP_CLONE : ${{ env.SKIP_GIT_CLONE == 'true' && env.CACHE_DOWNLOAD_FAILED == 'false'}}
181- ENABLE_CACHE : ${{ env.ENABLE_CACHE }}
182135 ENABLE_DEBUG_ARTIFACTS : ${{ env.ENABLE_DEBUG_ARTIFACTS }}
183136 RUN_ID : ${{ github.run_id }}
184137
185138 - name : Upload artifacts
186- if : ${{ env.ENABLE_DEBUG_ARTIFACTS == 'true' || env.ENABLE_CACHE == 'true' }}
139+ if : ${{ env.ENABLE_DEBUG_ARTIFACTS == 'true' }}
187140 uses : actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
188141 with :
189142 retention-days : 7
0 commit comments