Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 3 additions & 50 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,51 +79,7 @@ runs:
process.exit(1);
}

- name: Get condition variables
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
IS_NON_COMMIT_ARG: ${{ fromJSON(fromJSON(inputs.client_payload)).isNonCommitEvent }}
ENABLE_CACHE_ARG: ${{ env.ENABLE_CACHE }}
RUN_ID_ARG: ${{ fromJSON(fromJSON(inputs.client_payload)).artifactRunId }}
CACHE_DOWNLOAD_FAILED_ARG: ${{ env.CACHE_DOWNLOAD_FAILED }}
with:
script: |
require('${{ github.action_path }}/scripts/get-condition-vars.js')(core);

- name: Download cache artifact for cm repo
id: download-cache-for-cm-repo
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
if: ${{ env.SKIP_GIT_CLONE == 'true' && fromJSON(fromJSON(inputs.client_payload)).hasCmRepo == true }}
continue-on-error: true
with:
github-token: ${{ fromJSON(fromJSON(inputs.client_payload)).githubToken || github.token }}
repository: '${{ fromJSON(fromJSON(inputs.client_payload)).owner }}/${{ fromJSON(fromJSON(inputs.client_payload)).cmRepo }}'
run-id: ${{ fromJSON(fromJSON(inputs.client_payload)).artifactRunId }}
name: output
path: code/output

- name: Download cache artifact when cmRepo is false
id: download-cache
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
if: ${{ env.SKIP_GIT_CLONE == 'true' && fromJSON(fromJSON(inputs.client_payload)).hasCmRepo == false}}
continue-on-error: true
with:
github-token: ${{ fromJSON(fromJSON(inputs.client_payload)).githubToken || github.token }}
repository: ${{ inputs.full_repository }}
run-id: ${{ fromJSON(fromJSON(inputs.client_payload)).artifactRunId }}
name: output
path: code/output

- name: Check if download cache artifact failed
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
ARTIFACT_OUTCOME_ARG: ${{ steps.download-cache.outcome }}
ARTIFACT_OUTCOME_CM_REPO_ARG: ${{ steps.download-cache-for-cm-repo.outcome }}
with:
script: require('${{ github.action_path }}/scripts/check-cache-download-status')(core);

- name: Checkout Pull Request branches history
if: ${{ env.SHOULD_CHECKOUT == 'true' }}
shell: bash
run: |
cd gitstream && cd repo
Expand All @@ -136,13 +92,12 @@ runs:
git checkout $'${{ steps.safe-strings.outputs.head_ref }}'

- name: Create cm folder
if: ${{ env.SHOULD_CHECKOUT == 'true' }}
shell: bash
run: cd gitstream && mkdir cm

- name: Checkout cm repo
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
if: ${{ fromJSON(fromJSON(inputs.client_payload)).hasCmRepo == true && env.SHOULD_CHECKOUT == 'true'}}
if: ${{ fromJSON(fromJSON(inputs.client_payload)).hasCmRepo == true }}
with:
repository: '${{ fromJSON(fromJSON(inputs.client_payload)).owner }}/${{ fromJSON(fromJSON(inputs.client_payload)).cmRepo }}'
ref: ${{ fromJSON(fromJSON(inputs.client_payload)).cmRepoRef }}
Expand All @@ -151,7 +106,7 @@ runs:

- name: Checkout cm org
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
if: ${{ fromJSON(fromJSON(inputs.client_payload)).hasCmOrg == true && env.SHOULD_CHECKOUT == 'true'}}
if: ${{ fromJSON(fromJSON(inputs.client_payload)).hasCmOrg == true }}
with:
repository: 'cm/cm'
ref: ${{ fromJSON(fromJSON(inputs.client_payload)).cmOrgRef }}
Expand All @@ -177,13 +132,11 @@ runs:
RULES_RESOLVER_URL: ${{ inputs.resolver_url }}
RULES_RESOLVER_TOKEN: ${{ inputs.resolver_token }}
DEBUG_MODE: ${{ inputs.debug_mode }}
SHOULD_SKIP_CLONE: ${{ env.SKIP_GIT_CLONE == 'true' && env.CACHE_DOWNLOAD_FAILED == 'false'}}
ENABLE_CACHE: ${{ env.ENABLE_CACHE }}
ENABLE_DEBUG_ARTIFACTS: ${{ env.ENABLE_DEBUG_ARTIFACTS }}
RUN_ID: ${{ github.run_id }}

- name: Upload artifacts
if: ${{ env.ENABLE_DEBUG_ARTIFACTS == 'true' || env.ENABLE_CACHE == 'true' }}
if: ${{ env.ENABLE_DEBUG_ARTIFACTS == 'true' }}
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
retention-days: 7
Expand Down
23 changes: 0 additions & 23 deletions scripts/check-cache-download-status.js

This file was deleted.

28 changes: 0 additions & 28 deletions scripts/get-condition-vars.js

This file was deleted.