From 6b8f868a008bfa5e1f714cba46942ece59736ba8 Mon Sep 17 00:00:00 2001 From: aelovikov-intel Date: Tue, 13 Jun 2023 07:43:28 -0700 Subject: [PATCH] [CI] Improve devops/actions/cached_checkout (#9831) * Add ability to skip the merge * Setup alternates on the filesystem level so that other jobs in the workflow could work with GIT without setting the environment variable. --- devops/actions/cached_checkout/action.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/devops/actions/cached_checkout/action.yml b/devops/actions/cached_checkout/action.yml index 5413cad7a2457..dc31da2f5d007 100644 --- a/devops/actions/cached_checkout/action.yml +++ b/devops/actions/cached_checkout/action.yml @@ -16,6 +16,9 @@ inputs: default_branch: description: 'Name of the default branch' default: 'sycl' + merge: + description: 'Merge default branch after the checkout' + default: true runs: using: 'composite' @@ -41,10 +44,16 @@ runs: ref: ${{ inputs.ref }} path: ${{ inputs.path }} fetch-depth: 0 - - name: Merge sycl HEAD into current branch + - name: Setup alternates shell: bash env: GIT_ALTERNATE_OBJECT_DIRECTORIES: ${{ inputs.cache_path }}/${{ inputs.repository }}/.git/objects + run: | + echo $GIT_ALTERNATE_OBJECT_DIRECTORIES > ${{ inputs.path }}/.git/objects/info/alternates + - name: Merge sycl HEAD into current branch + shell: bash + if: ${{ inputs.merge == 'true' }} + env: DEFAULT_BRANCH: ${{ inputs.default_branch }} run: | cd ${{ inputs.path }}