# [PATCH] ci: bump remaining outdated Actions versions

7 messages from 2024-02-11 to 2024-02-12. Participants: Johannes Schindelin via GitGitGadget, Junio C Hamano.
Thread: https://gitlist.dev/t/60899

## Johannes Schindelin via GitGitGadget, 2024-02-11 11:52

Subject: [PATCH] ci: bump remaining outdated Actions versions
Message-ID: <pull.1660.git.1707652357696.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/pull.1660.git.1707652357696.gitgitgadget%40gmail.com

```
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>

This avoids "Node.js 16 Actions" deprecation messages by bumping the
following Actions' versions:

- actions/upload-artifact from 3 to 4
- actions/download-artifact from 3 to 4
- actions/cache from 3 to 4

Helped-by: Matthias Aßhauer <mha1993@live.de>
Original-commits-by: dependabot[bot] <support@github.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
    ci: bump remaining outdated Actions versions
    
    I noticed that Junio recently bumped a couple of these Actions versions,
    and incidentally I also activated automatic Dependabot updates of those
    in git-for-windows/git. Dependabot noticed a couple of yet-unaddressed
    updates, which I accumulated into a single patch.
    
    This patch is based on jc/github-actions-update.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1660%2Fdscho%2Fmoar-github-actions-updates-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1660/dscho/moar-github-actions-updates-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1660

 .github/workflows/coverity.yml |  4 ++--
 .github/workflows/main.yml     | 18 +++++++++---------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
index a81a7566d10..53cf12fe044 100644
--- a/.github/workflows/coverity.yml
+++ b/.github/workflows/coverity.yml
@@ -98,7 +98,7 @@ jobs:
       # A cache miss will add ~30s to create, but a cache hit will save minutes.
       - name: restore the Coverity Build Tool
         id: cache
-        uses: actions/cache/restore@v3
+        uses: actions/cache/restore@v4
         with:
           path: ${{ runner.temp }}/cov-analysis
           key: cov-build-${{ env.COVERITY_LANGUAGE }}-${{ env.COVERITY_PLATFORM }}-${{ steps.lookup.outputs.hash }}
@@ -141,7 +141,7 @@ jobs:
           esac
       - name: cache the Coverity Build Tool
         if: steps.cache.outputs.cache-hit != 'true'
-        uses: actions/cache/save@v3
+        uses: actions/cache/save@v4
         with:
           path: ${{ runner.temp }}/cov-analysis
           key: cov-build-${{ env.COVERITY_LANGUAGE }}-${{ env.COVERITY_PLATFORM }}-${{ steps.lookup.outputs.hash }}
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index bb857bdaf08..4eea49fc85c 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -123,7 +123,7 @@ jobs:
     - name: zip up tracked files
       run: git archive -o artifacts/tracked.tar.gz HEAD
     - name: upload tracked files and build artifacts
-      uses: actions/upload-artifact@v3
+      uses: actions/upload-artifact@v4
       with:
         name: windows-artifacts
         path: artifacts
@@ -140,7 +140,7 @@ jobs:
       cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
     steps:
     - name: download tracked files and build artifacts
-      uses: actions/download-artifact@v3
+      uses: actions/download-artifact@v4
       with:
         name: windows-artifacts
         path: ${{github.workspace}}
@@ -157,7 +157,7 @@ jobs:
       run: ci/print-test-failures.sh
     - name: Upload failed tests' directories
       if: failure() && env.FAILED_TEST_ARTIFACTS != ''
-      uses: actions/upload-artifact@v3
+      uses: actions/upload-artifact@v4
       with:
         name: failed-tests-windows
         path: ${{env.FAILED_TEST_ARTIFACTS}}
@@ -212,7 +212,7 @@ jobs:
     - name: zip up tracked files
       run: git archive -o artifacts/tracked.tar.gz HEAD
     - name: upload tracked files and build artifacts
-      uses: actions/upload-artifact@v3
+      uses: actions/upload-artifact@v4
       with:
         name: vs-artifacts
         path: artifacts
@@ -230,7 +230,7 @@ jobs:
     steps:
     - uses: git-for-windows/setup-git-for-windows-sdk@v1
     - name: download tracked files and build artifacts
-      uses: actions/download-artifact@v3
+      uses: actions/download-artifact@v4
       with:
         name: vs-artifacts
         path: ${{github.workspace}}
@@ -248,7 +248,7 @@ jobs:
       run: ci/print-test-failures.sh
     - name: Upload failed tests' directories
       if: failure() && env.FAILED_TEST_ARTIFACTS != ''
-      uses: actions/upload-artifact@v3
+      uses: actions/upload-artifact@v4
       with:
         name: failed-tests-windows
         path: ${{env.FAILED_TEST_ARTIFACTS}}
@@ -305,7 +305,7 @@ jobs:
       run: ci/print-test-failures.sh
     - name: Upload failed tests' directories
       if: failure() && env.FAILED_TEST_ARTIFACTS != ''
-      uses: actions/upload-artifact@v3
+      uses: actions/upload-artifact@v4
       with:
         name: failed-tests-${{matrix.vector.jobname}}
         path: ${{env.FAILED_TEST_ARTIFACTS}}
@@ -353,13 +353,13 @@ jobs:
       run: ci/print-test-failures.sh
     - name: Upload failed tests' directories
       if: failure() && env.FAILED_TEST_ARTIFACTS != '' && matrix.vector.jobname != 'linux32'
-      uses: actions/upload-artifact@v3
+      uses: actions/upload-artifact@v4
       with:
         name: failed-tests-${{matrix.vector.jobname}}
         path: ${{env.FAILED_TEST_ARTIFACTS}}
     - name: Upload failed tests' directories
       if: failure() && env.FAILED_TEST_ARTIFACTS != '' && matrix.vector.jobname == 'linux32'
-      uses: actions/upload-artifact@v1
+      uses: actions/upload-artifact@v4
       with:
         name: failed-tests-${{matrix.vector.jobname}}
         path: ${{env.FAILED_TEST_ARTIFACTS}}

base-commit: dcce2bda214ac4c838f4b85f2c550816df3a6ac9
-- 
gitgitgadget

```

## Johannes Schindelin via GitGitGadget, 2024-02-11 12:11

Subject: [PATCH v2 0/2] ci: bump remaining outdated Actions versions
Message-ID: <pull.1660.v2.git.1707653489.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/pull.1660.v2.git.1707653489.gitgitgadget%40gmail.com
In-Reply-To: <pull.1660.git.1707652357696.gitgitgadget@gmail.com>

```
I noticed that Junio recently bumped a couple of these Actions versions, and
incidentally I also activated automatic Dependabot updates of those in
git-for-windows/git. Dependabot noticed a couple of yet-unaddressed updates,
which I accumulated into a single patch.

This patch is based on jc/github-actions-update.

Changes since v1 (sorry for the quick succession):

 * The linux32 job cannot handle Node.js Actions, and therefore would fail
   to run the latest actions/upload-artifact version. I only noticed this
   after submitting v1 because CI does not fail (since this step is only in
   use when something in Git's test suite breaks).
 * To avoid making the same mistake even one more time, I added a commit
   that puts big fat warnings next to the Actions that must not be updated
   to newer (i.e. Node.js) versions.

Johannes Schindelin (2):
  ci: bump remaining outdated Actions versions
  ci(linux32): add a note about Actions that must not be updated

 .github/workflows/coverity.yml |  4 ++--
 .github/workflows/main.yml     | 20 ++++++++++----------
 2 files changed, 12 insertions(+), 12 deletions(-)


base-commit: dcce2bda214ac4c838f4b85f2c550816df3a6ac9
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1660%2Fdscho%2Fmoar-github-actions-updates-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1660/dscho/moar-github-actions-updates-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/1660

Range-diff vs v1:

 1:  77c0810bf1a ! 1:  2b35b9878a7 ci: bump remaining outdated Actions versions
     @@ .github/workflows/main.yml: jobs:
           - name: Upload failed tests' directories
             if: failure() && env.FAILED_TEST_ARTIFACTS != '' && matrix.vector.jobname != 'linux32'
      -      uses: actions/upload-artifact@v3
     -+      uses: actions/upload-artifact@v4
     -       with:
     -         name: failed-tests-${{matrix.vector.jobname}}
     -         path: ${{env.FAILED_TEST_ARTIFACTS}}
     -     - name: Upload failed tests' directories
     -       if: failure() && env.FAILED_TEST_ARTIFACTS != '' && matrix.vector.jobname == 'linux32'
     --      uses: actions/upload-artifact@v1
      +      uses: actions/upload-artifact@v4
             with:
               name: failed-tests-${{matrix.vector.jobname}}
 -:  ----------- > 2:  9088cc60bda ci(linux32): add a note about Actions that must not be updated

-- 
gitgitgadget

```

## Johannes Schindelin via GitGitGadget, 2024-02-11 12:11

Subject: [PATCH v2 1/2] ci: bump remaining outdated Actions versions
Message-ID: <2b35b9878a7ed6da268bff11c41a261ea774161f.1707653489.git.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/2b35b9878a7ed6da268bff11c41a261ea774161f.1707653489.git.gitgitgadget%40gmail.com
In-Reply-To: <pull.1660.v2.git.1707653489.gitgitgadget@gmail.com>

```
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>

This avoids "Node.js 16 Actions" deprecation messages by bumping the
following Actions' versions:

- actions/upload-artifact from 3 to 4
- actions/download-artifact from 3 to 4
- actions/cache from 3 to 4

Helped-by: Matthias Aßhauer <mha1993@live.de>
Original-commits-by: dependabot[bot] <support@github.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 .github/workflows/coverity.yml |  4 ++--
 .github/workflows/main.yml     | 16 ++++++++--------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
index a81a7566d10..53cf12fe044 100644
--- a/.github/workflows/coverity.yml
+++ b/.github/workflows/coverity.yml
@@ -98,7 +98,7 @@ jobs:
       # A cache miss will add ~30s to create, but a cache hit will save minutes.
       - name: restore the Coverity Build Tool
         id: cache
-        uses: actions/cache/restore@v3
+        uses: actions/cache/restore@v4
         with:
           path: ${{ runner.temp }}/cov-analysis
           key: cov-build-${{ env.COVERITY_LANGUAGE }}-${{ env.COVERITY_PLATFORM }}-${{ steps.lookup.outputs.hash }}
@@ -141,7 +141,7 @@ jobs:
           esac
       - name: cache the Coverity Build Tool
         if: steps.cache.outputs.cache-hit != 'true'
-        uses: actions/cache/save@v3
+        uses: actions/cache/save@v4
         with:
           path: ${{ runner.temp }}/cov-analysis
           key: cov-build-${{ env.COVERITY_LANGUAGE }}-${{ env.COVERITY_PLATFORM }}-${{ steps.lookup.outputs.hash }}
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index bb857bdaf08..ec25f6f99de 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -123,7 +123,7 @@ jobs:
     - name: zip up tracked files
       run: git archive -o artifacts/tracked.tar.gz HEAD
     - name: upload tracked files and build artifacts
-      uses: actions/upload-artifact@v3
+      uses: actions/upload-artifact@v4
       with:
         name: windows-artifacts
         path: artifacts
@@ -140,7 +140,7 @@ jobs:
       cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
     steps:
     - name: download tracked files and build artifacts
-      uses: actions/download-artifact@v3
+      uses: actions/download-artifact@v4
       with:
         name: windows-artifacts
         path: ${{github.workspace}}
@@ -157,7 +157,7 @@ jobs:
       run: ci/print-test-failures.sh
     - name: Upload failed tests' directories
       if: failure() && env.FAILED_TEST_ARTIFACTS != ''
-      uses: actions/upload-artifact@v3
+      uses: actions/upload-artifact@v4
       with:
         name: failed-tests-windows
         path: ${{env.FAILED_TEST_ARTIFACTS}}
@@ -212,7 +212,7 @@ jobs:
     - name: zip up tracked files
       run: git archive -o artifacts/tracked.tar.gz HEAD
     - name: upload tracked files and build artifacts
-      uses: actions/upload-artifact@v3
+      uses: actions/upload-artifact@v4
       with:
         name: vs-artifacts
         path: artifacts
@@ -230,7 +230,7 @@ jobs:
     steps:
     - uses: git-for-windows/setup-git-for-windows-sdk@v1
     - name: download tracked files and build artifacts
-      uses: actions/download-artifact@v3
+      uses: actions/download-artifact@v4
       with:
         name: vs-artifacts
         path: ${{github.workspace}}
@@ -248,7 +248,7 @@ jobs:
       run: ci/print-test-failures.sh
     - name: Upload failed tests' directories
       if: failure() && env.FAILED_TEST_ARTIFACTS != ''
-      uses: actions/upload-artifact@v3
+      uses: actions/upload-artifact@v4
       with:
         name: failed-tests-windows
         path: ${{env.FAILED_TEST_ARTIFACTS}}
@@ -305,7 +305,7 @@ jobs:
       run: ci/print-test-failures.sh
     - name: Upload failed tests' directories
       if: failure() && env.FAILED_TEST_ARTIFACTS != ''
-      uses: actions/upload-artifact@v3
+      uses: actions/upload-artifact@v4
       with:
         name: failed-tests-${{matrix.vector.jobname}}
         path: ${{env.FAILED_TEST_ARTIFACTS}}
@@ -353,7 +353,7 @@ jobs:
       run: ci/print-test-failures.sh
     - name: Upload failed tests' directories
       if: failure() && env.FAILED_TEST_ARTIFACTS != '' && matrix.vector.jobname != 'linux32'
-      uses: actions/upload-artifact@v3
+      uses: actions/upload-artifact@v4
       with:
         name: failed-tests-${{matrix.vector.jobname}}
         path: ${{env.FAILED_TEST_ARTIFACTS}}
-- 
gitgitgadget


```

## Johannes Schindelin via GitGitGadget, 2024-02-11 12:11

Subject: [PATCH v2 2/2] ci(linux32): add a note about Actions that must not be updated
Message-ID: <9088cc60bda0f3f0d152ddc3c22a60effa272483.1707653489.git.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/9088cc60bda0f3f0d152ddc3c22a60effa272483.1707653489.git.gitgitgadget%40gmail.com
In-Reply-To: <pull.1660.v2.git.1707653489.gitgitgadget@gmail.com>

```
From: Johannes Schindelin <johannes.schindelin@gmx.de>

The Docker container used by the `linux32` job comes without Node.js,
and therefore the `actions/checkout` and `actions/upload-artifact`
Actions cannot be upgraded to the latest versions (because they use
Node.js).

One time too many, I accidentally tried to update them, where
`actions/checkout` at least fails immediately, but the
`actions/upload-artifact` step is only used when any test fails, and
therefore the CI run usually passes even though that Action was updated
to a version that is incompatible with the Docker container in which
this job runs.

So let's add a big fat warning, mainly for my own benefit, to avoid
running into the very same issue over and over again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 .github/workflows/main.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index ec25f6f99de..7bacb322e4f 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -344,7 +344,7 @@ jobs:
     steps:
     - uses: actions/checkout@v4
       if: matrix.vector.jobname != 'linux32'
-    - uses: actions/checkout@v1
+    - uses: actions/checkout@v1 # cannot be upgraded because Node.js Actions aren't supported in this container
       if: matrix.vector.jobname == 'linux32'
     - run: ci/install-docker-dependencies.sh
     - run: ci/run-build-and-tests.sh
@@ -359,7 +359,7 @@ jobs:
         path: ${{env.FAILED_TEST_ARTIFACTS}}
     - name: Upload failed tests' directories
       if: failure() && env.FAILED_TEST_ARTIFACTS != '' && matrix.vector.jobname == 'linux32'
-      uses: actions/upload-artifact@v1
+      uses: actions/upload-artifact@v1 # cannot be upgraded because Node.js Actions aren't supported in this container
       with:
         name: failed-tests-${{matrix.vector.jobname}}
         path: ${{env.FAILED_TEST_ARTIFACTS}}
-- 
gitgitgadget

```

## Junio C Hamano, 2024-02-11 17:17

Subject: Re: [PATCH] ci: bump remaining outdated Actions versions
Message-ID: <xmqqplx29aze.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqplx29aze.fsf%40gitster.g
In-Reply-To: <pull.1660.git.1707652357696.gitgitgadget@gmail.com>

```
"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
>
> This avoids "Node.js 16 Actions" deprecation messages by bumping the
> following Actions' versions:
>
> - actions/upload-artifact from 3 to 4
> - actions/download-artifact from 3 to 4
> - actions/cache from 3 to 4
>
> Helped-by: Matthias Aßhauer <mha1993@live.de>
> Original-commits-by: dependabot[bot] <support@github.com>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---

>      - name: Upload failed tests' directories
>        if: failure() && env.FAILED_TEST_ARTIFACTS != '' && matrix.vector.jobname == 'linux32'
> -      uses: actions/upload-artifact@v1
> +      uses: actions/upload-artifact@v4
>        with:
>          name: failed-tests-${{matrix.vector.jobname}}
>          path: ${{env.FAILED_TEST_ARTIFACTS}}

Curious that, among all other uses of actions/upload-artifact@v3,
only this one has been using @v1, which may deserve explanation.
The proposed commit log message pretends that this never existed.

Please drop a non-standard "Original-commits-by:"  trailer, and
instead mention what you wrote under three-dash line about the
dependabot in the log message.  Perhaps something like...

	After activating automatic Dependabot updates in the
	git-for-windows/git repository, Dependabot noticed a couple
	of yet-unaddressed updates.  They avoid "Node.js 16 Actions"
	deprecation messages by bumping the following Actions'
	versions:

        - actions/upload-artifact from 1 or 3 to 4
        - actions/download-artifact from 3 to 4
        - actions/cache from 3 to 4

	Note that one actions/upload-artifact@v1 was used in one of
	the rules because ...

        Helped-by: Matthias Aßhauer <mha1993@live.de>
        Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>


Thanks.

```

## Junio C Hamano, 2024-02-12 16:46

Subject: Re: [PATCH] ci: bump remaining outdated Actions versions
Message-ID: <xmqqv86t7hr7.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqv86t7hr7.fsf%40gitster.g
In-Reply-To: <xmqqplx29aze.fsf@gitster.g>

```
Junio C Hamano <gitster@pobox.com> writes:

> Curious that, among all other uses of actions/upload-artifact@v3,
> only this one has been using @v1, which may deserve explanation.
> The proposed commit log message pretends that this never existed.

I see that [v2 2/2] addresses this.  Nice.

```

## Junio C Hamano, 2024-02-12 16:51

Subject: Re: [PATCH v2 2/2] ci(linux32): add a note about Actions that must not be updated
Message-ID: <xmqqr0hh7hih.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqr0hh7hih.fsf%40gitster.g
In-Reply-To: <9088cc60bda0f3f0d152ddc3c22a60effa272483.1707653489.git.gitgitgadget@gmail.com>

```
"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> So let's add a big fat warning, mainly for my own benefit, to avoid
> running into the very same issue over and over again.

If we had this, it would also have helped me when I did e94dec0c
(GitHub Actions: update to checkout@v4, 2024-02-02), as I wouldn't
have had to dig for 6cf4d908 (ci(main): upgrade actions/checkout to
v3, 2022-12-05).

Thanks.

```
