git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [PATCH] ci: avoid using the deprecated `set-env` construct
@ 2020-11-07  1:21 Johannes Schindelin via GitGitGadget
  2020-11-07  6:51 ` Chris Webster
  2020-11-17  6:19 ` Junio C Hamano
  0 siblings, 2 replies; 6+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-07  1:21 UTC (permalink / raw)
  To: git; +Cc: Chris. Webster, Johannes Schindelin, Johannes Schindelin

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

The `set-env` construct was deprecated as of the announcement in
https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

Let's use the recommended alternative instead.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
    ci: avoid using the deprecated set-env construct
    
    This avoids an ugly warning (see e.g. this run
    [https://github.com/gitgitgadget/git/actions/runs/350443139]).

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-781%2Fdscho%2Fno-set-env-in-github-workflows-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-781/dscho/no-set-env-in-github-workflows-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/781

 .github/workflows/check-whitespace.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml
index 9d070b9cdf..c74b47de9e 100644
--- a/.github/workflows/check-whitespace.yml
+++ b/.github/workflows/check-whitespace.yml
@@ -14,7 +14,7 @@ jobs:
     steps:
     - name: Set commit count
       shell: bash
-      run: echo "::set-env name=COMMIT_DEPTH::$((1+$COMMITS))"
+      run: echo "COMMIT_DEPTH=$((1+$COMMITS))" >>$GITHUB_ENV
       env:
         COMMITS: ${{ github.event.pull_request.commits }}
 

base-commit: 7f7ebe054af6d831b999d6c2241b9227c4e4e08d
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ci: avoid using the deprecated `set-env` construct
  2020-11-07  1:21 [PATCH] ci: avoid using the deprecated `set-env` construct Johannes Schindelin via GitGitGadget
@ 2020-11-07  6:51 ` Chris Webster
  2020-11-17  6:19 ` Junio C Hamano
  1 sibling, 0 replies; 6+ messages in thread
From: Chris Webster @ 2020-11-07  6:51 UTC (permalink / raw)
  Cc: git

Looks good.  Doing a similar change in a related repo.

...chris.

...chris.
chris@webstech.net
webstech.com


On Fri, Nov 6, 2020 at 5:21 PM Johannes Schindelin via GitGitGadget
<gitgitgadget@gmail.com> wrote:
>
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> The `set-env` construct was deprecated as of the announcement in
> https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
>
> Let's use the recommended alternative instead.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>     ci: avoid using the deprecated set-env construct
>
>     This avoids an ugly warning (see e.g. this run
>     [https://github.com/gitgitgadget/git/actions/runs/350443139]).
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-781%2Fdscho%2Fno-set-env-in-github-workflows-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-781/dscho/no-set-env-in-github-workflows-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/781
>
>  .github/workflows/check-whitespace.yml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml
> index 9d070b9cdf..c74b47de9e 100644
> --- a/.github/workflows/check-whitespace.yml
> +++ b/.github/workflows/check-whitespace.yml
> @@ -14,7 +14,7 @@ jobs:
>      steps:
>      - name: Set commit count
>        shell: bash
> -      run: echo "::set-env name=COMMIT_DEPTH::$((1+$COMMITS))"
> +      run: echo "COMMIT_DEPTH=$((1+$COMMITS))" >>$GITHUB_ENV
>        env:
>          COMMITS: ${{ github.event.pull_request.commits }}
>
>
> base-commit: 7f7ebe054af6d831b999d6c2241b9227c4e4e08d
> --
> gitgitgadget

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ci: avoid using the deprecated `set-env` construct
  2020-11-07  1:21 [PATCH] ci: avoid using the deprecated `set-env` construct Johannes Schindelin via GitGitGadget
  2020-11-07  6:51 ` Chris Webster
@ 2020-11-17  6:19 ` Junio C Hamano
  2020-11-17 15:21   ` Johannes Schindelin
  1 sibling, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2020-11-17  6:19 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget
  Cc: git, Chris. Webster, Johannes Schindelin

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

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> The `set-env` construct was deprecated as of the announcement in
> https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
> ...
> diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml
> index 9d070b9cdf..c74b47de9e 100644
> --- a/.github/workflows/check-whitespace.yml
> +++ b/.github/workflows/check-whitespace.yml
> @@ -14,7 +14,7 @@ jobs:
>      steps:
>      - name: Set commit count
>        shell: bash
> -      run: echo "::set-env name=COMMIT_DEPTH::$((1+$COMMITS))"
> +      run: echo "COMMIT_DEPTH=$((1+$COMMITS))" >>$GITHUB_ENV
>        env:
>          COMMITS: ${{ github.event.pull_request.commits }}

Do we need something similar for ci/print-test-failures.sh to
prevent failures like https://github.com/git/git/runs/1409815807?

Perhaps like the following (which is copied-and-pasted without
understanding what is going on or without doing nothing more than
skimming [*1*])?


Reference

*1* https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable


 ci/print-test-failures.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git c/ci/print-test-failures.sh w/ci/print-test-failures.sh
index 92a983a265..c70d6cdbf2 100755
--- c/ci/print-test-failures.sh
+++ w/ci/print-test-failures.sh
@@ -48,7 +48,7 @@ do
 			;;
 		github-actions)
 			mkdir -p failed-test-artifacts
-			echo "::set-env name=FAILED_TEST_ARTIFACTS::t/failed-test-artifacts"
+			echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV
 			cp "${TEST_EXIT%.exit}.out" failed-test-artifacts/
 			tar czf failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir"
 			continue


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ci: avoid using the deprecated `set-env` construct
  2020-11-17  6:19 ` Junio C Hamano
@ 2020-11-17 15:21   ` Johannes Schindelin
  2020-11-17 20:14     ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Schindelin @ 2020-11-17 15:21 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin via GitGitGadget, git, Chris. Webster

Hi Junio,

On Mon, 16 Nov 2020, Junio C Hamano wrote:

> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
> writes:
>
> > From: Johannes Schindelin <johannes.schindelin@gmx.de>
> >
> > The `set-env` construct was deprecated as of the announcement in
> > https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
> > ...
> > diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml
> > index 9d070b9cdf..c74b47de9e 100644
> > --- a/.github/workflows/check-whitespace.yml
> > +++ b/.github/workflows/check-whitespace.yml
> > @@ -14,7 +14,7 @@ jobs:
> >      steps:
> >      - name: Set commit count
> >        shell: bash
> > -      run: echo "::set-env name=COMMIT_DEPTH::$((1+$COMMITS))"
> > +      run: echo "COMMIT_DEPTH=$((1+$COMMITS))" >>$GITHUB_ENV
> >        env:
> >          COMMITS: ${{ github.event.pull_request.commits }}
>
> Do we need something similar for ci/print-test-failures.sh to
> prevent failures like https://github.com/git/git/runs/1409815807?
>
> Perhaps like the following (which is copied-and-pasted without
> understanding what is going on or without doing nothing more than
> skimming [*1*])?

Yes, of course, this precisely what we need.

Sorry for not even _thinking_ about `git grep set-env`. This seems the
only remaining use of that construct in our workflows, though.

Thanks,
Dscho

>
>
> Reference
>
> *1* https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
>
>
>  ci/print-test-failures.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git c/ci/print-test-failures.sh w/ci/print-test-failures.sh
> index 92a983a265..c70d6cdbf2 100755
> --- c/ci/print-test-failures.sh
> +++ w/ci/print-test-failures.sh
> @@ -48,7 +48,7 @@ do
>  			;;
>  		github-actions)
>  			mkdir -p failed-test-artifacts
> -			echo "::set-env name=FAILED_TEST_ARTIFACTS::t/failed-test-artifacts"
> +			echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV
>  			cp "${TEST_EXIT%.exit}.out" failed-test-artifacts/
>  			tar czf failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir"
>  			continue
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ci: avoid using the deprecated `set-env` construct
  2020-11-17 15:21   ` Johannes Schindelin
@ 2020-11-17 20:14     ` Junio C Hamano
  2020-11-18 11:48       ` Johannes Schindelin
  0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2020-11-17 20:14 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Johannes Schindelin via GitGitGadget, git, Chris. Webster

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

>> Perhaps like the following (which is copied-and-pasted without
>> understanding what is going on or without doing nothing more than
>> skimming [*1*])?
>
> Yes, of course, this precisely what we need.

Thanks.

--- >8 ------ >8 ------ >8 --- cut here --- >8 ------ >8 ------ >8 ---

Subject: [PATCH] ci: avoid `set-env` construct in print-test-failures.sh

Imitating cac42e47 (ci: avoid using the deprecated `set-env`
construct, 2020-11-07), avoid deprecated ::set-env and use the
recommended alternative instead in print-test-failures.sh

Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 ci/print-test-failures.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ci/print-test-failures.sh b/ci/print-test-failures.sh
index 92a983a265..c70d6cdbf2 100755
--- a/ci/print-test-failures.sh
+++ b/ci/print-test-failures.sh
@@ -48,7 +48,7 @@ do
 			;;
 		github-actions)
 			mkdir -p failed-test-artifacts
-			echo "::set-env name=FAILED_TEST_ARTIFACTS::t/failed-test-artifacts"
+			echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV
 			cp "${TEST_EXIT%.exit}.out" failed-test-artifacts/
 			tar czf failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir"
 			continue
-- 
2.29.2-458-g8cf0a80384


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ci: avoid using the deprecated `set-env` construct
  2020-11-17 20:14     ` Junio C Hamano
@ 2020-11-18 11:48       ` Johannes Schindelin
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Schindelin @ 2020-11-18 11:48 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin via GitGitGadget, git, Chris. Webster

Hi Junio,

On Tue, 17 Nov 2020, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> >> Perhaps like the following (which is copied-and-pasted without
> >> understanding what is going on or without doing nothing more than
> >> skimming [*1*])?
> >
> > Yes, of course, this precisely what we need.
>
> Thanks.
>
> --- >8 ------ >8 ------ >8 --- cut here --- >8 ------ >8 ------ >8 ---
>
> Subject: [PATCH] ci: avoid `set-env` construct in print-test-failures.sh
>
> Imitating cac42e47 (ci: avoid using the deprecated `set-env`
> construct, 2020-11-07), avoid deprecated ::set-env and use the
> recommended alternative instead in print-test-failures.sh
>
> Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Thank you so much for tying up this loose end,
Dscho

> ---
>  ci/print-test-failures.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ci/print-test-failures.sh b/ci/print-test-failures.sh
> index 92a983a265..c70d6cdbf2 100755
> --- a/ci/print-test-failures.sh
> +++ b/ci/print-test-failures.sh
> @@ -48,7 +48,7 @@ do
>  			;;
>  		github-actions)
>  			mkdir -p failed-test-artifacts
> -			echo "::set-env name=FAILED_TEST_ARTIFACTS::t/failed-test-artifacts"
> +			echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV
>  			cp "${TEST_EXIT%.exit}.out" failed-test-artifacts/
>  			tar czf failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir"
>  			continue
> --
> 2.29.2-458-g8cf0a80384
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-11-18 11:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-07  1:21 [PATCH] ci: avoid using the deprecated `set-env` construct Johannes Schindelin via GitGitGadget
2020-11-07  6:51 ` Chris Webster
2020-11-17  6:19 ` Junio C Hamano
2020-11-17 15:21   ` Johannes Schindelin
2020-11-17 20:14     ` Junio C Hamano
2020-11-18 11:48       ` Johannes Schindelin

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).