Skip to content

Commit

Permalink
LINBEE-9077 - add the ability to skip clone + download artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeela Lifshitz authored and Yeela Lifshitz committed Aug 11, 2024
1 parent e14e309 commit 73bb5d1
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ runs:
}
- name: Checkout Pull Request branches history
if: ${{ (fromJson(inputs.client_payload).shouldUseCache || 'false') == 'false' && (fromJson(inputs.client_payload).isCacheEnable || 'false') == 'false' }}
shell: bash
run: |
ALL=2147483647
Expand All @@ -96,12 +97,13 @@ runs:
git checkout $'${{ steps.safe-strings.outputs.head_ref }}'
- name: Create cm folder
if: ${{ (fromJson(inputs.client_payload).shouldUseCache || 'false') == 'false' && (fromJson(inputs.client_payload).isCacheEnable || 'false') == 'false' }}
shell: bash
run: cd gitstream && mkdir cm

- name: Checkout cm repo
uses: actions/checkout@v4
if: ${{ fromJSON(fromJSON(inputs.client_payload)).hasCmRepo == true }}
if: ${{ (fromJson(inputs.client_payload).shouldUseCache || 'false') == 'false' && (fromJson(inputs.client_payload).isCacheEnable || 'false') == 'false' && 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 @@ -111,6 +113,24 @@ runs:
shell: bash
run: mv gitstream code

- name: Download cache artifact
id: run-data-artifact
uses: actions/download-artifact@v4
if: ${{ fromJson(inputs.client_payload).shouldUseCache == 'true' && fromJson(inputs.client_payload).isCacheEnable == '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

- name: Read artifact content
id: read-artifact
shell: bash
run: |
cat $GITHUB_WORKSPACE/run_data_cache.json
RUN_DATA_CACHE=$(cat $GITHUB_WORKSPACE/run_data_cache.json | jq -c)
echo "RUN_DATA_CACHE=$RUN_DATA_CACHE" >> $GITHUB_ENV
- name: Install Dependencies for plugins
shell: bash
run: npm i --silent moment lodash axios @octokit/rest
Expand All @@ -125,3 +145,6 @@ runs:
RULES_RESOLVER_URL: ${{ inputs.resolver_url }}
RULES_RESOLVER_TOKEN: ${{ inputs.resolver_token }}
DEBUG_MODE: ${{ inputs.debug_mode }}
SHOULD_USE_CACHE: ${{ fromJSON(fromJSON(inputs.client_payload)).shouldUseCache || 'false' }}
IS_CACHE_ENABLE: ${{ fromJSON(fromJSON(inputs.client_payload)).isCacheEnable || 'false' }}
RUN_DATA_CACHE: ${{ env.RUN_DATA_CACHE }}

0 comments on commit 73bb5d1

Please sign in to comment.