{"thread":{"id":"58915","subject":"[PATCH 0/4] Avoid using deprecated features in Git's GitHub workflows","startedAt":"2022-12-07T14:34:50Z","lastAt":"2022-12-08T05:50:57Z","messageCount":11,"participants":["Johannes Schindelin via GitGitGadget","Taylor Blau","Ævar Arnfjörð Bjarmason","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"468715","messageId":"pull.1440.git.1670423680.gitgitgadget@gmail.com","threadId":"58915","inReplyTo":null,"subject":"[PATCH 0/4] Avoid using deprecated features in Git's GitHub workflows","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-12-07T14:34:36Z","receivedAt":"2022-12-07T14:34:50Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"We are using a couple of GitHub Actions features that have been deprecated\nsince we started using them. One of these features is addressed in Oscar's\ncontribution over at\nhttps://lore.kernel.org/git/pull.1354.v2.git.git.1670234474721.gitgitgadget@gmail.com/,\non which this here patch series is based.\n\nI waited for quite a while with submitting this because I did not want to\ninterfere with patch series that are in flight, but it seems that this was\nunwise, as there is now a patch floating about (ab/ci-retire-set-output)\nthat partially fulfills this here patch series' purpose. However, these\npatches are more complete, so I proposed to supersede that patch with this\nmore comprehensive solution.\n\nThis patch series is based on od/ci-use-checkout-v3-when-applicable.\n\nJohannes Schindelin (4):\n  ci: use a newer `github-script` version\n  ci: avoid deprecated `set-output` workflow command\n  ci: avoid using deprecated {up,down}load-artifacts Action\n  ci(l10n): avoid using the deprecated `set-output` workflow command\n\n .github/workflows/l10n.yml |  4 ++--\n .github/workflows/main.yml | 30 ++++++++++++++++++------------\n 2 files changed, 20 insertions(+), 14 deletions(-)\n\n\nbase-commit: 6cf4d908a92296654f891d440fe09d9fd34b2272\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1440%2Fdscho%2Fci-set-output-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1440/dscho/ci-set-output-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/1440\n-- \ngitgitgadget\n"},{"id":"468716","messageId":"472481561f03900fb519065d88ae8af910bea794.1670423680.git.gitgitgadget@gmail.com","threadId":"58915","inReplyTo":"pull.1440.git.1670423680.gitgitgadget@gmail.com","subject":"[PATCH 1/4] ci: use a newer `github-script` version","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-12-07T14:34:37Z","receivedAt":"2022-12-07T14:34:52Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThe old version we currently use runs in node.js v12.x, which is being\ndeprecated in GitHub Actions. The new version uses node.js v16.x.\n\nIncidentally, this also avoids the warning about the deprecated\n`::set-output::` workflow command because the newer version of the\n`github-script` Action uses the recommended new way to specify outputs.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Taylor Blau <me@ttaylorr.com>\n---\n .github/workflows/main.yml | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\nindex 5262823eb1c..43d47824dd3 100644\n--- a/.github/workflows/main.yml\n+++ b/.github/workflows/main.yml\n@@ -37,14 +37,14 @@ jobs:\n           echo \"::set-output name=enabled::$enabled\"\n       - name: skip if the commit or tree was already tested\n         id: skip-if-redundant\n-        uses: actions/github-script@v3\n+        uses: actions/github-script@v6\n         if: steps.check-ref.outputs.enabled == 'yes'\n         with:\n           github-token: ${{secrets.GITHUB_TOKEN}}\n           script: |\n             try {\n               // Figure out workflow ID, commit and tree\n-              const { data: run } = await github.actions.getWorkflowRun({\n+              const { data: run } = await github.rest.actions.getWorkflowRun({\n                 owner: context.repo.owner,\n                 repo: context.repo.repo,\n                 run_id: context.runId,\n@@ -54,7 +54,7 @@ jobs:\n               const tree_id = run.head_commit.tree_id;\n \n               // See whether there is a successful run for that commit or tree\n-              const { data: runs } = await github.actions.listWorkflowRuns({\n+              const { data: runs } = await github.rest.actions.listWorkflowRuns({\n                 owner: context.repo.owner,\n                 repo: context.repo.repo,\n                 per_page: 500,\n-- \ngitgitgadget\n\n"},{"id":"468717","messageId":"1693393443975bc25f3020e61a29944804e35601.1670423680.git.gitgitgadget@gmail.com","threadId":"58915","inReplyTo":"pull.1440.git.1670423680.gitgitgadget@gmail.com","subject":"[PATCH 2/4] ci: avoid deprecated `set-output` workflow command","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-12-07T14:34:38Z","receivedAt":"2022-12-07T14:34:55Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nDue to security concerns, this command was deprecated and we need to\nwrite into `$GITHUB_OUTPUT` instead. For more details, see\nhttps://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n .github/workflows/main.yml | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\nindex 43d47824dd3..1e95aa86b6c 100644\n--- a/.github/workflows/main.yml\n+++ b/.github/workflows/main.yml\n@@ -34,7 +34,7 @@ jobs:\n           then\n             enabled=no\n           fi\n-          echo \"::set-output name=enabled::$enabled\"\n+          echo \"enabled=$enabled\" >>$GITHUB_OUTPUT\n       - name: skip if the commit or tree was already tested\n         id: skip-if-redundant\n         uses: actions/github-script@v6\n-- \ngitgitgadget\n\n"},{"id":"468718","messageId":"c9e99b4f96fc4e513c62b1b028e45559f6410c57.1670423680.git.gitgitgadget@gmail.com","threadId":"58915","inReplyTo":"pull.1440.git.1670423680.gitgitgadget@gmail.com","subject":"[PATCH 3/4] ci: avoid using deprecated {up,down}load-artifacts Action","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-12-07T14:34:39Z","receivedAt":"2022-12-07T14:35:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThe deprecated versions of these Actions still use node.js 12 whereas\nworkflows will need to use node.js 16 to avoid problems going forward.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n .github/workflows/main.yml | 22 ++++++++++++++--------\n 1 file changed, 14 insertions(+), 8 deletions(-)\n\ndiff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\nindex 1e95aa86b6c..5e82d8d2b1b 100644\n--- a/.github/workflows/main.yml\n+++ b/.github/workflows/main.yml\n@@ -94,7 +94,7 @@ jobs:\n     - name: zip up tracked files\n       run: git archive -o artifacts/tracked.tar.gz HEAD\n     - name: upload tracked files and build artifacts\n-      uses: actions/upload-artifact@v2\n+      uses: actions/upload-artifact@v3\n       with:\n         name: windows-artifacts\n         path: artifacts\n@@ -108,7 +108,7 @@ jobs:\n         nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n     steps:\n     - name: download tracked files and build artifacts\n-      uses: actions/download-artifact@v2\n+      uses: actions/download-artifact@v3\n       with:\n         name: windows-artifacts\n         path: ${{github.workspace}}\n@@ -125,7 +125,7 @@ jobs:\n       run: ci/print-test-failures.sh\n     - name: Upload failed tests' directories\n       if: failure() && env.FAILED_TEST_ARTIFACTS != ''\n-      uses: actions/upload-artifact@v2\n+      uses: actions/upload-artifact@v3\n       with:\n         name: failed-tests-windows\n         path: ${{env.FAILED_TEST_ARTIFACTS}}\n@@ -177,7 +177,7 @@ jobs:\n     - name: zip up tracked files\n       run: git archive -o artifacts/tracked.tar.gz HEAD\n     - name: upload tracked files and build artifacts\n-      uses: actions/upload-artifact@v2\n+      uses: actions/upload-artifact@v3\n       with:\n         name: vs-artifacts\n         path: artifacts\n@@ -192,7 +192,7 @@ jobs:\n     steps:\n     - uses: git-for-windows/setup-git-for-windows-sdk@v1\n     - name: download tracked files and build artifacts\n-      uses: actions/download-artifact@v2\n+      uses: actions/download-artifact@v3\n       with:\n         name: vs-artifacts\n         path: ${{github.workspace}}\n@@ -210,7 +210,7 @@ jobs:\n       run: ci/print-test-failures.sh\n     - name: Upload failed tests' directories\n       if: failure() && env.FAILED_TEST_ARTIFACTS != ''\n-      uses: actions/upload-artifact@v2\n+      uses: actions/upload-artifact@v3\n       with:\n         name: failed-tests-windows\n         path: ${{env.FAILED_TEST_ARTIFACTS}}\n@@ -267,7 +267,7 @@ jobs:\n       run: ci/print-test-failures.sh\n     - name: Upload failed tests' directories\n       if: failure() && env.FAILED_TEST_ARTIFACTS != ''\n-      uses: actions/upload-artifact@v2\n+      uses: actions/upload-artifact@v3\n       with:\n         name: failed-tests-${{matrix.vector.jobname}}\n         path: ${{env.FAILED_TEST_ARTIFACTS}}\n@@ -302,7 +302,13 @@ jobs:\n       shell: bash\n       run: ci/print-test-failures.sh\n     - name: Upload failed tests' directories\n-      if: failure() && env.FAILED_TEST_ARTIFACTS != ''\n+      if: failure() && env.FAILED_TEST_ARTIFACTS != '' && matrix.vector.jobname != 'linux32'\n+      uses: actions/upload-artifact@v3\n+      with:\n+        name: failed-tests-${{matrix.vector.jobname}}\n+        path: ${{env.FAILED_TEST_ARTIFACTS}}\n+    - name: Upload failed tests' directories\n+      if: failure() && env.FAILED_TEST_ARTIFACTS != '' && matrix.vector.jobname == 'linux32'\n       uses: actions/upload-artifact@v1\n       with:\n         name: failed-tests-${{matrix.vector.jobname}}\n-- \ngitgitgadget\n\n"},{"id":"468719","messageId":"1081c62fb266bc41f7084ea2a974729315a7634a.1670423680.git.gitgitgadget@gmail.com","threadId":"58915","inReplyTo":"pull.1440.git.1670423680.gitgitgadget@gmail.com","subject":"[PATCH 4/4] ci(l10n): avoid using the deprecated `set-output` workflow command","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-12-07T14:34:40Z","receivedAt":"2022-12-07T14:35:12Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nWe need to use an environment file now. For more information see:\nhttps://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n .github/workflows/l10n.yml | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/.github/workflows/l10n.yml b/.github/workflows/l10n.yml\nindex 27f72f0ff34..2915c595b4f 100644\n--- a/.github/workflows/l10n.yml\n+++ b/.github/workflows/l10n.yml\n@@ -23,8 +23,8 @@ jobs:\n             base=${{ github.event.before }}\n             head=${{ github.event.after }}\n           fi\n-          echo \"::set-output name=base::$base\"\n-          echo \"::set-output name=head::$head\"\n+          echo \"base=$base\" >>$GITHUB_OUTPUT\n+          echo \"head=$head\" >>$GITHUB_OUTPUT\n       - name: Run partial clone\n         run: |\n           git -c init.defaultBranch=master init --bare .\n-- \ngitgitgadget\n"},{"id":"468739","messageId":"Y5ESKYvOyrnbCV+B@nand.local","threadId":"58915","inReplyTo":"472481561f03900fb519065d88ae8af910bea794.1670423680.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/4] ci: use a newer `github-script` version","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2022-12-07T22:22:33Z","receivedAt":"2022-12-07T22:22:40Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Wed, Dec 07, 2022 at 02:34:37PM +0000, Johannes Schindelin via GitGitGadget wrote:\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> The old version we currently use runs in node.js v12.x, which is being\n> deprecated in GitHub Actions. The new version uses node.js v16.x.\n>\n> Incidentally, this also avoids the warning about the deprecated\n> `::set-output::` workflow command because the newer version of the\n> `github-script` Action uses the recommended new way to specify outputs.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Signed-off-by: Taylor Blau <me@ttaylorr.com>\n\nIt took me a second to remember why my S-o-b was here, but it looks like\nthis is from when I queued this patch in [1], which is on 'master' as of\n63357b79c9 (ci: use a newer `github-script` version, 2022-11-08).\n\nSo having my S-o-b here is definitely OK (since I was the one who put it\nthere in the first place!), but I don't think we need to re-queue this\npatch, unless it was reverted out in the meantime (which it doesn't\nappear to be).\n\nThanks,\nTaylor\n\n[1]: https://lore.kernel.org/git/Y2q9723uEtfkJrah@nand.local/\n"},{"id":"468740","messageId":"Y5ESknffj5iWF0IY@nand.local","threadId":"58915","inReplyTo":"1693393443975bc25f3020e61a29944804e35601.1670423680.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 2/4] ci: avoid deprecated `set-output` workflow command","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2022-12-07T22:24:18Z","receivedAt":"2022-12-07T22:24:23Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Wed, Dec 07, 2022 at 02:34:38PM +0000, Johannes Schindelin via GitGitGadget wrote:\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> Due to security concerns, this command was deprecated and we need to\n> write into `$GITHUB_OUTPUT` instead. For more details, see\n> https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/\n\nOK, this one and [1] are pretty similar. I don't have a strong\npreference between one or the other, though I suspect it will be easier\nfor the maintainer to pick them all up from the same series.\n\nSo in that sense I guess I have a slight preference for this one, though\nI admit to not feeling very strongly about it ;-).\n\nThanks,\nTaylor\n\n[1]: https://lore.kernel.org/git/patch-1.1-deb65805345-20221206T195811Z-avarab@gmail.com/\n"},{"id":"468744","messageId":"Y5EWUNbR1X+GrrNs@nand.local","threadId":"58915","inReplyTo":"pull.1440.git.1670423680.gitgitgadget@gmail.com","subject":"Re: [PATCH 0/4] Avoid using deprecated features in Git's GitHub workflows","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2022-12-07T22:40:16Z","receivedAt":"2022-12-07T22:40:25Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Wed, Dec 07, 2022 at 02:34:36PM +0000, Johannes Schindelin via GitGitGadget wrote:\n> Johannes Schindelin (4):\n>   ci: use a newer `github-script` version\n>   ci: avoid deprecated `set-output` workflow command\n>   ci: avoid using deprecated {up,down}load-artifacts Action\n>   ci(l10n): avoid using the deprecated `set-output` workflow command\n\nThese all look reasonable to me, minus the first one which is already\non 'master' as-is (unless I am missing something, but see my reply to\nthat email).\n\nThanks,\nTaylor\n"},{"id":"468745","messageId":"221207.86r0xa9618.gmgdl@evledraar.gmail.com","threadId":"58915","inReplyTo":"pull.1440.git.1670423680.gitgitgadget@gmail.com","subject":"Re: [PATCH 0/4] Avoid using deprecated features in Git's GitHub workflows","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2022-12-07T22:42:21Z","receivedAt":"2022-12-07T22:56:58Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Wed, Dec 07 2022, Johannes Schindelin via GitGitGadget wrote:\n\n> I waited for quite a while with submitting this because I did not want to\n> interfere with patch series that are in flight, but it seems that this was\n> unwise, as there is now a patch floating about (ab/ci-retire-set-output)\n> that partially fulfills this here patch series' purpose. However, these\n> patches are more complete, so I proposed to supersede that patch with this\n> more comprehensive solution.\n\nWhat does \"more complete\" here mean? Just that this series is doing more\nthings than stand-alone patches?\n\n> This patch series is based on od/ci-use-checkout-v3-when-applicable.\n>\n> Johannes Schindelin (4):\n>   ci: use a newer `github-script` version\n\nIs this the patch that needs or interacts with\nod/ci-use-checkout-v3-when-applicable?\n\nI don't see it in \"What's Cooking\", but \"seen\" currently has\n\"gitster/js/ci-set-output\", which looks to be from\n[1]\n\n>   ci: avoid deprecated `set-output` workflow command\n\nThis is byte-for-byte the same as the second hunk in my [2].\n\n>   ci: avoid using deprecated {up,down}load-artifacts Action\n\nMost of this looks good & doesn't duplicate any existing patch, but why\nis there a change in there that disables the uploading of failed test\ndirectories for the \"linux32\" job?\n\n>   ci(l10n): avoid using the deprecated `set-output` workflow command\n\nThis does the same as the first hunk in my [2], you're just using two\n\"echo\", I used a here-doc.\n\nI think what would make it valuable to bundle these up is if doing so\nwould resolve some tricky interference between these patches.\n\nBut I don't see that that's the case, and we can e.g. start writing to\n\"$GITHUB_OUTPUT\" independent of other changes.\n\n1. https://lore.kernel.org/git/pull.1387.git.1667902408921.gitgitgadget@gmail.com/\n2. https://lore.kernel.org/git/patch-v2-1.1-4e7db0db3be-20221207T014848Z-avarab@gmail.com/\n"},{"id":"468755","messageId":"xmqqv8mm4vgu.fsf@gitster.g","threadId":"58915","inReplyTo":"Y5EWUNbR1X+GrrNs@nand.local","subject":"Re: [PATCH 0/4] Avoid using deprecated features in Git's GitHub workflows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-12-07T23:58:41Z","receivedAt":"2022-12-07T23:58:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Taylor Blau <me@ttaylorr.com> writes:\n\n> On Wed, Dec 07, 2022 at 02:34:36PM +0000, Johannes Schindelin via GitGitGadget wrote:\n>> Johannes Schindelin (4):\n>>   ci: use a newer `github-script` version\n>>   ci: avoid deprecated `set-output` workflow command\n>>   ci: avoid using deprecated {up,down}load-artifacts Action\n>>   ci(l10n): avoid using the deprecated `set-output` workflow command\n>\n> These all look reasonable to me, minus the first one which is already\n> on 'master' as-is (unless I am missing something, but see my reply to\n> that email).\n\nI think we already have set-output ones figured out and queued in\n'seen', and the third one alone cleanly applies without any others\n(and replaces my botched attempt ;-), so we are in good shape, I\nthink.\n\nThanks.\n"},{"id":"468765","messageId":"xmqqh6y64f5v.fsf@gitster.g","threadId":"58915","inReplyTo":"xmqqv8mm4vgu.fsf@gitster.g","subject":"Re: [PATCH 0/4] Avoid using deprecated features in Git's GitHub workflows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-12-08T05:50:52Z","receivedAt":"2022-12-08T05:50:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Taylor Blau <me@ttaylorr.com> writes:\n>\n>> On Wed, Dec 07, 2022 at 02:34:36PM +0000, Johannes Schindelin via GitGitGadget wrote:\n>>> Johannes Schindelin (4):\n>>>   ci: use a newer `github-script` version\n>>>   ci: avoid deprecated `set-output` workflow command\n>>>   ci: avoid using deprecated {up,down}load-artifacts Action\n>>>   ci(l10n): avoid using the deprecated `set-output` workflow command\n>>\n>> These all look reasonable to me, minus the first one which is already\n>> on 'master' as-is (unless I am missing something, but see my reply to\n>> that email).\n>\n> I think we already have set-output ones figured out and queued in\n> 'seen', and the third one alone cleanly applies without any others\n> (and replaces my botched attempt ;-), so we are in good shape, I\n> think.\n\nSo, with \"checkout@v3\" by Oscar a few days ago, \"set-output to\n$GITHUB_OUTPUT\" by Ævar yesterday, and the \"upload/download\nartifact@v3\" in this series, all queued near the tip of 'next', all\nthe deprecation warnings we have been seeing are now gone, cf.\n\n  https://github.com/git/git/actions/runs/3644168470\n\nUnfortunately, a new one says that ubuntu-22.04 will soon be used\nwhen ubuntu-latest is called for X-<.\n\nIn any case, thank you, everybody, for cleaning up the CI workers.\n\n"}]}