{"thread":{"id":"54595","subject":"[PATCH] ci: avoid using the deprecated `set-env` construct","startedAt":"2020-11-07T01:21:50Z","lastAt":"2020-11-18T11:49:01Z","messageCount":6,"participants":["Johannes Schindelin via GitGitGadget","Chris Webster","Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"409313","messageId":"pull.781.git.1604712106219.gitgitgadget@gmail.com","threadId":"54595","inReplyTo":null,"subject":"[PATCH] ci: avoid using the deprecated `set-env` construct","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-11-07T01:21:45Z","receivedAt":"2020-11-07T01:21:50Z","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 `set-env` construct was deprecated as of the announcement in\nhttps://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/\n\nLet's use the recommended alternative instead.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n    ci: avoid using the deprecated set-env construct\n    \n    This avoids an ugly warning (see e.g. this run\n    [https://github.com/gitgitgadget/git/actions/runs/350443139]).\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-781%2Fdscho%2Fno-set-env-in-github-workflows-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-781/dscho/no-set-env-in-github-workflows-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/781\n\n .github/workflows/check-whitespace.yml | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml\nindex 9d070b9cdf..c74b47de9e 100644\n--- a/.github/workflows/check-whitespace.yml\n+++ b/.github/workflows/check-whitespace.yml\n@@ -14,7 +14,7 @@ jobs:\n     steps:\n     - name: Set commit count\n       shell: bash\n-      run: echo \"::set-env name=COMMIT_DEPTH::$((1+$COMMITS))\"\n+      run: echo \"COMMIT_DEPTH=$((1+$COMMITS))\" >>$GITHUB_ENV\n       env:\n         COMMITS: ${{ github.event.pull_request.commits }}\n \n\nbase-commit: 7f7ebe054af6d831b999d6c2241b9227c4e4e08d\n-- \ngitgitgadget\n"},{"id":"409318","messageId":"CAGT1KpXgzaFUdvmZXHHTC6r2FjYY_6MCiZPHu++eje1mRJfmPQ@mail.gmail.com","threadId":"54595","inReplyTo":"pull.781.git.1604712106219.gitgitgadget@gmail.com","subject":"Re: [PATCH] ci: avoid using the deprecated `set-env` construct","fromName":"Chris Webster","fromEmail":"chris@webstech.net","sentAt":"2020-11-07T06:51:43Z","receivedAt":"2020-11-07T06:57:48Z","isPatch":true,"sender":{"key":"chris@webstech.net","avatar":"https://avatars.githubusercontent.com/u/7956947?v=4"},"body":"Looks good.  Doing a similar change in a related repo.\n\n...chris.\n\n...chris.\nchris@webstech.net\nwebstech.com\n\n\nOn Fri, Nov 6, 2020 at 5:21 PM Johannes Schindelin via GitGitGadget\n<gitgitgadget@gmail.com> wrote:\n>\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> The `set-env` construct was deprecated as of the announcement in\n> https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/\n>\n> Let's use the recommended alternative instead.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>     ci: avoid using the deprecated set-env construct\n>\n>     This avoids an ugly warning (see e.g. this run\n>     [https://github.com/gitgitgadget/git/actions/runs/350443139]).\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-781%2Fdscho%2Fno-set-env-in-github-workflows-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-781/dscho/no-set-env-in-github-workflows-v1\n> Pull-Request: https://github.com/gitgitgadget/git/pull/781\n>\n>  .github/workflows/check-whitespace.yml | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml\n> index 9d070b9cdf..c74b47de9e 100644\n> --- a/.github/workflows/check-whitespace.yml\n> +++ b/.github/workflows/check-whitespace.yml\n> @@ -14,7 +14,7 @@ jobs:\n>      steps:\n>      - name: Set commit count\n>        shell: bash\n> -      run: echo \"::set-env name=COMMIT_DEPTH::$((1+$COMMITS))\"\n> +      run: echo \"COMMIT_DEPTH=$((1+$COMMITS))\" >>$GITHUB_ENV\n>        env:\n>          COMMITS: ${{ github.event.pull_request.commits }}\n>\n>\n> base-commit: 7f7ebe054af6d831b999d6c2241b9227c4e4e08d\n> --\n> gitgitgadget\n"},{"id":"410068","messageId":"xmqq8sb07bfa.fsf@gitster.c.googlers.com","threadId":"54595","inReplyTo":"pull.781.git.1604712106219.gitgitgadget@gmail.com","subject":"Re: [PATCH] ci: avoid using the deprecated `set-env` construct","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-11-17T06:19:21Z","receivedAt":"2020-11-17T06:19:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> The `set-env` construct was deprecated as of the announcement in\n> https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/\n> ...\n> diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml\n> index 9d070b9cdf..c74b47de9e 100644\n> --- a/.github/workflows/check-whitespace.yml\n> +++ b/.github/workflows/check-whitespace.yml\n> @@ -14,7 +14,7 @@ jobs:\n>      steps:\n>      - name: Set commit count\n>        shell: bash\n> -      run: echo \"::set-env name=COMMIT_DEPTH::$((1+$COMMITS))\"\n> +      run: echo \"COMMIT_DEPTH=$((1+$COMMITS))\" >>$GITHUB_ENV\n>        env:\n>          COMMITS: ${{ github.event.pull_request.commits }}\n\nDo we need something similar for ci/print-test-failures.sh to\nprevent failures like https://github.com/git/git/runs/1409815807?\n\nPerhaps like the following (which is copied-and-pasted without\nunderstanding what is going on or without doing nothing more than\nskimming [*1*])?\n\n\nReference\n\n*1* https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable\n\n\n ci/print-test-failures.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git c/ci/print-test-failures.sh w/ci/print-test-failures.sh\nindex 92a983a265..c70d6cdbf2 100755\n--- c/ci/print-test-failures.sh\n+++ w/ci/print-test-failures.sh\n@@ -48,7 +48,7 @@ do\n \t\t\t;;\n \t\tgithub-actions)\n \t\t\tmkdir -p failed-test-artifacts\n-\t\t\techo \"::set-env name=FAILED_TEST_ARTIFACTS::t/failed-test-artifacts\"\n+\t\t\techo \"FAILED_TEST_ARTIFACTS=t/failed-test-artifacts\" >>$GITHUB_ENV\n \t\t\tcp \"${TEST_EXIT%.exit}.out\" failed-test-artifacts/\n \t\t\ttar czf failed-test-artifacts/\"$test_name\".trash.tar.gz \"$trash_dir\"\n \t\t\tcontinue\n\n"},{"id":"410084","messageId":"nycvar.QRO.7.76.6.2011171620180.18437@tvgsbejvaqbjf.bet","threadId":"54595","inReplyTo":"xmqq8sb07bfa.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] ci: avoid using the deprecated `set-env` construct","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-11-17T15:21:33Z","receivedAt":"2020-11-17T15:21:41Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Mon, 16 Nov 2020, Junio C Hamano wrote:\n\n> \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> writes:\n>\n> > From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> >\n> > The `set-env` construct was deprecated as of the announcement in\n> > https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/\n> > ...\n> > diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml\n> > index 9d070b9cdf..c74b47de9e 100644\n> > --- a/.github/workflows/check-whitespace.yml\n> > +++ b/.github/workflows/check-whitespace.yml\n> > @@ -14,7 +14,7 @@ jobs:\n> >      steps:\n> >      - name: Set commit count\n> >        shell: bash\n> > -      run: echo \"::set-env name=COMMIT_DEPTH::$((1+$COMMITS))\"\n> > +      run: echo \"COMMIT_DEPTH=$((1+$COMMITS))\" >>$GITHUB_ENV\n> >        env:\n> >          COMMITS: ${{ github.event.pull_request.commits }}\n>\n> Do we need something similar for ci/print-test-failures.sh to\n> prevent failures like https://github.com/git/git/runs/1409815807?\n>\n> Perhaps like the following (which is copied-and-pasted without\n> understanding what is going on or without doing nothing more than\n> skimming [*1*])?\n\nYes, of course, this precisely what we need.\n\nSorry for not even _thinking_ about `git grep set-env`. This seems the\nonly remaining use of that construct in our workflows, though.\n\nThanks,\nDscho\n\n>\n>\n> Reference\n>\n> *1* https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable\n>\n>\n>  ci/print-test-failures.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git c/ci/print-test-failures.sh w/ci/print-test-failures.sh\n> index 92a983a265..c70d6cdbf2 100755\n> --- c/ci/print-test-failures.sh\n> +++ w/ci/print-test-failures.sh\n> @@ -48,7 +48,7 @@ do\n>  \t\t\t;;\n>  \t\tgithub-actions)\n>  \t\t\tmkdir -p failed-test-artifacts\n> -\t\t\techo \"::set-env name=FAILED_TEST_ARTIFACTS::t/failed-test-artifacts\"\n> +\t\t\techo \"FAILED_TEST_ARTIFACTS=t/failed-test-artifacts\" >>$GITHUB_ENV\n>  \t\t\tcp \"${TEST_EXIT%.exit}.out\" failed-test-artifacts/\n>  \t\t\ttar czf failed-test-artifacts/\"$test_name\".trash.tar.gz \"$trash_dir\"\n>  \t\t\tcontinue\n>\n>\n"},{"id":"410125","messageId":"xmqq8saz68ro.fsf@gitster.c.googlers.com","threadId":"54595","inReplyTo":"nycvar.QRO.7.76.6.2011171620180.18437@tvgsbejvaqbjf.bet","subject":"Re: [PATCH] ci: avoid using the deprecated `set-env` construct","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-11-17T20:14:19Z","receivedAt":"2020-11-17T20:14:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> Perhaps like the following (which is copied-and-pasted without\n>> understanding what is going on or without doing nothing more than\n>> skimming [*1*])?\n>\n> Yes, of course, this precisely what we need.\n\nThanks.\n\n--- >8 ------ >8 ------ >8 --- cut here --- >8 ------ >8 ------ >8 ---\n\nSubject: [PATCH] ci: avoid `set-env` construct in print-test-failures.sh\n\nImitating cac42e47 (ci: avoid using the deprecated `set-env`\nconstruct, 2020-11-07), avoid deprecated ::set-env and use the\nrecommended alternative instead in print-test-failures.sh\n\nHelped-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n ci/print-test-failures.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/ci/print-test-failures.sh b/ci/print-test-failures.sh\nindex 92a983a265..c70d6cdbf2 100755\n--- a/ci/print-test-failures.sh\n+++ b/ci/print-test-failures.sh\n@@ -48,7 +48,7 @@ do\n \t\t\t;;\n \t\tgithub-actions)\n \t\t\tmkdir -p failed-test-artifacts\n-\t\t\techo \"::set-env name=FAILED_TEST_ARTIFACTS::t/failed-test-artifacts\"\n+\t\t\techo \"FAILED_TEST_ARTIFACTS=t/failed-test-artifacts\" >>$GITHUB_ENV\n \t\t\tcp \"${TEST_EXIT%.exit}.out\" failed-test-artifacts/\n \t\t\ttar czf failed-test-artifacts/\"$test_name\".trash.tar.gz \"$trash_dir\"\n \t\t\tcontinue\n-- \n2.29.2-458-g8cf0a80384\n\n"},{"id":"410221","messageId":"nycvar.QRO.7.76.6.2011181248320.56@tvgsbejvaqbjf.bet","threadId":"54595","inReplyTo":"xmqq8saz68ro.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] ci: avoid using the deprecated `set-env` construct","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-11-18T11:48:53Z","receivedAt":"2020-11-18T11:49:01Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Tue, 17 Nov 2020, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n> >> Perhaps like the following (which is copied-and-pasted without\n> >> understanding what is going on or without doing nothing more than\n> >> skimming [*1*])?\n> >\n> > Yes, of course, this precisely what we need.\n>\n> Thanks.\n>\n> --- >8 ------ >8 ------ >8 --- cut here --- >8 ------ >8 ------ >8 ---\n>\n> Subject: [PATCH] ci: avoid `set-env` construct in print-test-failures.sh\n>\n> Imitating cac42e47 (ci: avoid using the deprecated `set-env`\n> construct, 2020-11-07), avoid deprecated ::set-env and use the\n> recommended alternative instead in print-test-failures.sh\n>\n> Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\nThank you so much for tying up this loose end,\nDscho\n\n> ---\n>  ci/print-test-failures.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/ci/print-test-failures.sh b/ci/print-test-failures.sh\n> index 92a983a265..c70d6cdbf2 100755\n> --- a/ci/print-test-failures.sh\n> +++ b/ci/print-test-failures.sh\n> @@ -48,7 +48,7 @@ do\n>  \t\t\t;;\n>  \t\tgithub-actions)\n>  \t\t\tmkdir -p failed-test-artifacts\n> -\t\t\techo \"::set-env name=FAILED_TEST_ARTIFACTS::t/failed-test-artifacts\"\n> +\t\t\techo \"FAILED_TEST_ARTIFACTS=t/failed-test-artifacts\" >>$GITHUB_ENV\n>  \t\t\tcp \"${TEST_EXIT%.exit}.out\" failed-test-artifacts/\n>  \t\t\ttar czf failed-test-artifacts/\"$test_name\".trash.tar.gz \"$trash_dir\"\n>  \t\t\tcontinue\n> --\n> 2.29.2-458-g8cf0a80384\n>\n>\n"}]}