From de692d2dd7117b80e6298c932275796cef46f199 Mon Sep 17 00:00:00 2001 From: "John T. Wodder II" Date: Tue, 14 Nov 2023 09:19:30 -0500 Subject: [PATCH] Make the build workflows only check out .github/ and patches/ from master --- .github/workflows/build-macos.yaml | 6 +++--- .github/workflows/build-ubuntu.yaml | 6 +++--- .github/workflows/build-windows.yaml | 6 +++--- .../template/build-{{ostype}}.yaml.j2 | 18 +++++++++--------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-macos.yaml b/.github/workflows/build-macos.yaml index e8f543220d..d948605ba5 100644 --- a/.github/workflows/build-macos.yaml +++ b/.github/workflows/build-macos.yaml @@ -60,10 +60,10 @@ jobs: run: | # The goal here is for $BUILD_COMMIT to be the HEAD (necessary for # git-annex's version detection to use the correct git commit) with - # the contents of master — or whatever ref is being used as the - # workflow source — also available. + # the .github/ and patches/ trees from master — or whatever ref is + # being used as the workflow source — also available. git checkout "$BUILD_COMMIT" - git checkout "$GITHUB_SHA" -- . + git checkout "$GITHUB_SHA" -- .github patches - name: Get build version id: build-version diff --git a/.github/workflows/build-ubuntu.yaml b/.github/workflows/build-ubuntu.yaml index 806f622498..d15113e29b 100644 --- a/.github/workflows/build-ubuntu.yaml +++ b/.github/workflows/build-ubuntu.yaml @@ -79,10 +79,10 @@ jobs: run: | # The goal here is for $BUILD_COMMIT to be the HEAD (necessary for # git-annex's version detection to use the correct git commit) with - # the contents of master — or whatever ref is being used as the - # workflow source — also available. + # the .github/ and patches/ trees from master — or whatever ref is + # being used as the workflow source — also available. git checkout "$BUILD_COMMIT" - git checkout "$GITHUB_SHA" -- . + git checkout "$GITHUB_SHA" -- .github patches - name: Get build version id: build-version diff --git a/.github/workflows/build-windows.yaml b/.github/workflows/build-windows.yaml index 04f7e5ef19..3f1621b474 100644 --- a/.github/workflows/build-windows.yaml +++ b/.github/workflows/build-windows.yaml @@ -66,14 +66,14 @@ jobs: run: | # The goal here is for $BUILD_COMMIT to be the HEAD (necessary for # git-annex's version detection to use the correct git commit) with - # the contents of master — or whatever ref is being used as the - # workflow source — also available. + # the .github/ and patches/ trees from master — or whatever ref is + # being used as the workflow source — also available. git reset --soft "$BUILD_COMMIT" # Avoid checking out unnecessary files with paths that are invalid on # Windows. git ls-tree --name-only HEAD | grep -v '^doc$' | xargs git checkout HEAD git checkout HEAD doc/license ':(glob)doc/*.mdwn' ':(glob)doc/logo*' - git checkout "$GITHUB_SHA" -- . + git checkout "$GITHUB_SHA" -- .github patches - name: Get build version id: build-version diff --git a/.github/workflows/template/build-{{ostype}}.yaml.j2 b/.github/workflows/template/build-{{ostype}}.yaml.j2 index e8b13aaf6a..44fbde5176 100644 --- a/.github/workflows/template/build-{{ostype}}.yaml.j2 +++ b/.github/workflows/template/build-{{ostype}}.yaml.j2 @@ -33,7 +33,7 @@ jobs: build-version: ${{ steps.build-version.outputs.version }} steps: - name: Checkout this repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -96,8 +96,8 @@ jobs: run: | # The goal here is for $BUILD_COMMIT to be the HEAD (necessary for # git-annex's version detection to use the correct git commit) with - # the contents of master — or whatever ref is being used as the - # workflow source — also available. + # the .github/ and patches/ trees from master — or whatever ref is + # being used as the workflow source — also available. {% if ostype == "windows" %} git reset --soft "$BUILD_COMMIT" # Avoid checking out unnecessary files with paths that are invalid on @@ -107,7 +107,7 @@ jobs: {% else %} git checkout "$BUILD_COMMIT" {% endif %} - git checkout "$GITHUB_SHA" -- . + git checkout "$GITHUB_SHA" -- .github patches - name: Get build version id: build-version @@ -277,7 +277,7 @@ jobs: {% if ostype == "ubuntu" %} - name: Clone datalad/git-annex-ci-client-jobs if: contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: datalad/git-annex-ci-client-jobs fetch-depth: 1 @@ -384,7 +384,7 @@ jobs: {% endif %} steps: - name: Checkout this repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create pending PR status if: github.event.inputs.pr != '' @@ -539,7 +539,7 @@ jobs: needs: build-package steps: - name: Checkout this repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create pending PR status if: github.event.inputs.pr != '' @@ -600,7 +600,7 @@ jobs: fail-fast: false steps: - name: Checkout this repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create pending PR status if: github.event.inputs.pr != '' @@ -732,7 +732,7 @@ jobs: # needed for ssh certs under ubuntu and tox.ini everywhere - name: Checkout datalad - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: datalad/datalad path: datalad