From 1f1a430efc5f97b9e2750d3dde243c43dfbb0a71 Mon Sep 17 00:00:00 2001 From: Hazel Date: Tue, 21 Nov 2023 18:54:46 +0000 Subject: [PATCH 1/4] add check whether submodules exist --- .github/workflows/build-shit.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-shit.yml b/.github/workflows/build-shit.yml index 22fccbf09..0b3cac25e 100644 --- a/.github/workflows/build-shit.yml +++ b/.github/workflows/build-shit.yml @@ -14,8 +14,19 @@ jobs: - name: ensure git cli is installed run: apt update && apt install sudo git -y - uses: actions/checkout@v3 - - name: print latest_commit - run: echo ${{ github.sha }} + with: + submodules: 'recursive' + token: ${{ secrets.GH_RO_PAT }} + - name: check whether submodules exist + run: + # debug output + echo gh=${{ github.sha }} + echo head=$(git rev-parse HEAD) + echo art=$(git -C art rev-parse HEAD) + echo assets=$(git -C assets rev-parse HEAD) + # checks if HEAD commit hash in submodules is diff from current repo, and therefore exists + test $(git rev-parse HEAD) != $(git -C art rev-parse HEAD) + test $(git rev-parse HEAD) != $(git -C assets rev-parse HEAD) - id: should_run continue-on-error: true name: check latest commit is less than a day From b6d7fc95e77d28be4a7b16b16ace1cfc71810c90 Mon Sep 17 00:00:00 2001 From: Hazel Date: Tue, 21 Nov 2023 18:55:45 +0000 Subject: [PATCH 2/4] yaml --- .github/workflows/build-shit.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-shit.yml b/.github/workflows/build-shit.yml index 0b3cac25e..fb3cd16a7 100644 --- a/.github/workflows/build-shit.yml +++ b/.github/workflows/build-shit.yml @@ -18,12 +18,13 @@ jobs: submodules: 'recursive' token: ${{ secrets.GH_RO_PAT }} - name: check whether submodules exist - run: + run: | # debug output echo gh=${{ github.sha }} echo head=$(git rev-parse HEAD) echo art=$(git -C art rev-parse HEAD) echo assets=$(git -C assets rev-parse HEAD) + # checks if HEAD commit hash in submodules is diff from current repo, and therefore exists test $(git rev-parse HEAD) != $(git -C art rev-parse HEAD) test $(git rev-parse HEAD) != $(git -C assets rev-parse HEAD) From 01019d1422638d32a596213fae33f8ab42aeef53 Mon Sep 17 00:00:00 2001 From: Hazel Date: Tue, 21 Nov 2023 18:59:41 +0000 Subject: [PATCH 3/4] update actions/checkout to v4 --- .github/workflows/build-shit.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-shit.yml b/.github/workflows/build-shit.yml index fb3cd16a7..9d73c8120 100644 --- a/.github/workflows/build-shit.yml +++ b/.github/workflows/build-shit.yml @@ -13,7 +13,7 @@ jobs: steps: - name: ensure git cli is installed run: apt update && apt install sudo git -y - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' token: ${{ secrets.GH_RO_PAT }} @@ -45,7 +45,7 @@ jobs: apt install sudo git curl unzip -y echo $GITHUB_WORKSPACE git config --global --add safe.directory $GITHUB_WORKSPACE - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' token: ${{ secrets.GH_RO_PAT }} @@ -68,7 +68,7 @@ jobs: contents: write actions: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' token: ${{ secrets.GH_RO_PAT }} @@ -103,7 +103,7 @@ jobs: # contents: write # actions: write # steps: -# - uses: actions/checkout@v3 +# - uses: actions/checkout@v4 # with: # submodules: 'recursive' # token: ${{ secrets.GH_RO_PAT }} From 6e6958a3bd306a41e0dde2751a2e9a37aeaa46ce Mon Sep 17 00:00:00 2001 From: Hazel Date: Tue, 21 Nov 2023 19:17:34 +0000 Subject: [PATCH 4/4] safe.directory moment --- .github/workflows/build-shit.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-shit.yml b/.github/workflows/build-shit.yml index 9d73c8120..be8bf6516 100644 --- a/.github/workflows/build-shit.yml +++ b/.github/workflows/build-shit.yml @@ -19,6 +19,8 @@ jobs: token: ${{ secrets.GH_RO_PAT }} - name: check whether submodules exist run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + # debug output echo gh=${{ github.sha }} echo head=$(git rev-parse HEAD)