From 03565ecd6a9ef9a9efcc68557685d39498bcabda Mon Sep 17 00:00:00 2001 From: Joao Paulo Magalhaes Date: Sat, 6 Jul 2024 20:52:51 +0100 Subject: [PATCH] CI: fix manual git checkout --- .github/workflows/clang.yml | 10 +++++++++- .github/workflows/gcc.yml | 40 +++++++++++++++++++++++++++++++++---- 2 files changed, 45 insertions(+), 5 deletions(-) diff --git a/.github/workflows/clang.yml b/.github/workflows/clang.yml index 707a4fb..3056069 100644 --- a/.github/workflows/clang.yml +++ b/.github/workflows/clang.yml @@ -158,7 +158,15 @@ jobs: #... so we checkout manually: - name: checkout run: | - git clone --recursive https://github.com/biojppm/c4core . + set -x + echo $GITHUB_SERVER_URL + echo $GITHUB_REPOSITORY + echo $GITHUB_HEAD_REF + git init -q . + git remote add $GITHUB_SERVER_URL/$GITHUB_REPOSITORY + git fetch origin $GITHUB_HEAD_REF + git reset --hard FETCH_HEAD + git submodule update --init --recursive - run: git config --system --add safe.directory '*' # needed for running in the docker image. see https://github.com/actions/checkout/issues/1169 - run: c4core-install ${{matrix.cxx}} - {name: show info, run: source .github/setenv.sh && c4_show_info} diff --git a/.github/workflows/gcc.yml b/.github/workflows/gcc.yml index 80a25f6..55c41e4 100644 --- a/.github/workflows/gcc.yml +++ b/.github/workflows/gcc.yml @@ -52,7 +52,15 @@ jobs: #... so we checkout manually: - name: checkout run: | - git clone --recursive https://github.com/biojppm/c4core . + set -x + echo $GITHUB_SERVER_URL + echo $GITHUB_REPOSITORY + echo $GITHUB_HEAD_REF + git init -q . + git remote add $GITHUB_SERVER_URL/$GITHUB_REPOSITORY + git fetch origin $GITHUB_HEAD_REF + git reset --hard FETCH_HEAD + git submodule update --init --recursive - run: git config --system --add safe.directory '*' # needed for running in the docker image. see https://github.com/actions/checkout/issues/1169 - run: c4core-install ${{matrix.cxx}} - {name: show info, run: source .github/setenv.sh && c4_show_info} @@ -99,7 +107,15 @@ jobs: #... so we checkout manually: - name: checkout run: | - git clone --recursive https://github.com/biojppm/c4core . + set -x + echo $GITHUB_SERVER_URL + echo $GITHUB_REPOSITORY + echo $GITHUB_HEAD_REF + git init -q . + git remote add $GITHUB_SERVER_URL/$GITHUB_REPOSITORY + git fetch origin $GITHUB_HEAD_REF + git reset --hard FETCH_HEAD + git submodule update --init --recursive - run: git config --system --add safe.directory '*' # needed for running in the docker image. see https://github.com/actions/checkout/issues/1169 - run: c4core-install ${{matrix.cxx}} - {name: show info, run: source .github/setenv.sh && c4_show_info} @@ -174,7 +190,15 @@ jobs: #... so we checkout manually: - name: checkout run: | - git clone --recursive https://github.com/biojppm/c4core . + set -x + echo $GITHUB_SERVER_URL + echo $GITHUB_REPOSITORY + echo $GITHUB_HEAD_REF + git init -q . + git remote add $GITHUB_SERVER_URL/$GITHUB_REPOSITORY + git fetch origin $GITHUB_HEAD_REF + git reset --hard FETCH_HEAD + git submodule update --init --recursive - run: git config --system --add safe.directory '*' # needed for running in the docker image. see https://github.com/actions/checkout/issues/1169 - run: c4core-install ${{matrix.cxx}} - {name: show info, run: source .github/setenv.sh && c4_show_info} @@ -277,7 +301,15 @@ jobs: #... so we checkout manually: - name: checkout run: | - git clone --recursive https://github.com/biojppm/c4core . + set -x + echo $GITHUB_SERVER_URL + echo $GITHUB_REPOSITORY + echo $GITHUB_HEAD_REF + git init -q . + git remote add $GITHUB_SERVER_URL/$GITHUB_REPOSITORY + git fetch origin $GITHUB_HEAD_REF + git reset --hard FETCH_HEAD + git submodule update --init --recursive - run: git config --system --add safe.directory '*' # needed for running in the docker image. see https://github.com/actions/checkout/issues/1169 - name: install gcc-arm-linux-gnueabihf run: |