git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] CI: migrate away from deprecated "set-output" syntax
@ 2022-12-06 20:00 Ævar Arnfjörð Bjarmason
  2022-12-06 20:50 ` Victoria Dye
  2022-12-07  1:49 ` [PATCH v2] " Ævar Arnfjörð Bjarmason
  0 siblings, 2 replies; 9+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-12-06 20:00 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

As noted in [1] and the warnings the CI itself is spewing echoing
outputs to stdout is deprecated, and they should be written to
"$GITHUB_OUTPUT" instead.

1. https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---

Along with my just-sent
https://lore.kernel.org/git/patch-1.1-4c1dcc89e7a-20221206T195552Z-avarab@gmail.com/
and Junio's https://lore.kernel.org/git/xmqq1qpd9bys.fsf@gitster.g/
this should make our CI warning free.

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

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 9afacfa0b33..d1e16009b11 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -34,7 +34,7 @@ jobs:
           then
             enabled=no
           fi
-          echo "::set-output name=enabled::$enabled"
+          echo "enabled=$enabled" >>$GITHUB_OUTPUT
       - name: skip if the commit or tree was already tested
         id: skip-if-redundant
         uses: actions/github-script@v6
-- 
2.39.0.rc2.1017.g5f0c708352f


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

* Re: [PATCH] CI: migrate away from deprecated "set-output" syntax
  2022-12-06 20:00 [PATCH] CI: migrate away from deprecated "set-output" syntax Ævar Arnfjörð Bjarmason
@ 2022-12-06 20:50 ` Victoria Dye
  2022-12-06 21:08   ` Ævar Arnfjörð Bjarmason
  2022-12-07  1:49 ` [PATCH v2] " Ævar Arnfjörð Bjarmason
  1 sibling, 1 reply; 9+ messages in thread
From: Victoria Dye @ 2022-12-06 20:50 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason, git; +Cc: Junio C Hamano

Ævar Arnfjörð Bjarmason wrote:
> As noted in [1] and the warnings the CI itself is spewing echoing
> outputs to stdout is deprecated, and they should be written to
> "$GITHUB_OUTPUT" instead.
> 
> 1. https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Interesting, I didn't realize this changed! The new syntax is certainly much
nicer to read.

> 
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
> 
> Along with my just-sent
> https://lore.kernel.org/git/patch-1.1-4c1dcc89e7a-20221206T195552Z-avarab@gmail.com/
> and Junio's https://lore.kernel.org/git/xmqq1qpd9bys.fsf@gitster.g/
> this should make our CI warning free.
> 
>  .github/workflows/main.yml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Should this also be updated for 'l10n.yml'? There are two usages of
'::set-output' there as well.

> 
> diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
> index 9afacfa0b33..d1e16009b11 100644
> --- a/.github/workflows/main.yml
> +++ b/.github/workflows/main.yml
> @@ -34,7 +34,7 @@ jobs:
>            then
>              enabled=no
>            fi
> -          echo "::set-output name=enabled::$enabled"
> +          echo "enabled=$enabled" >>$GITHUB_OUTPUT

Looks good!

>        - name: skip if the commit or tree was already tested
>          id: skip-if-redundant
>          uses: actions/github-script@v6


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

* Re: [PATCH] CI: migrate away from deprecated "set-output" syntax
  2022-12-06 20:50 ` Victoria Dye
@ 2022-12-06 21:08   ` Ævar Arnfjörð Bjarmason
  2022-12-07  0:56     ` Taylor Blau
  0 siblings, 1 reply; 9+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-12-06 21:08 UTC (permalink / raw)
  To: Victoria Dye; +Cc: git, Junio C Hamano


On Tue, Dec 06 2022, Victoria Dye wrote:

> Ævar Arnfjörð Bjarmason wrote:
> [...]
>> 
>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
>> ---
>> 
>> Along with my just-sent
>> https://lore.kernel.org/git/patch-1.1-4c1dcc89e7a-20221206T195552Z-avarab@gmail.com/
>> and Junio's https://lore.kernel.org/git/xmqq1qpd9bys.fsf@gitster.g/
>> this should make our CI warning free.
>> 
>>  .github/workflows/main.yml | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Should this also be updated for 'l10n.yml'? There are two usages of
> '::set-output' there as well.

Yes, I just missed that one. I'll fix that, but will wait a bit to see
if there's any other comments first. Thanks!

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

* Re: [PATCH] CI: migrate away from deprecated "set-output" syntax
  2022-12-06 21:08   ` Ævar Arnfjörð Bjarmason
@ 2022-12-07  0:56     ` Taylor Blau
  0 siblings, 0 replies; 9+ messages in thread
From: Taylor Blau @ 2022-12-07  0:56 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Victoria Dye, git, Junio C Hamano

On Tue, Dec 06, 2022 at 10:08:36PM +0100, Ævar Arnfjörð Bjarmason wrote:
> > Should this also be updated for 'l10n.yml'? There are two usages of
> > '::set-output' there as well.
>
> Yes, I just missed that one. I'll fix that, but will wait a bit to see
> if there's any other comments first. Thanks!

No concerns from me. I noticed this warning when I was looking at all of
the CI builds a few weeks ago.

This transition looks obviously correct to me, and as long as we apply
it in the l10n workflow as Victoria mentions, this should be good to go.

Thanks,
Taylor

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

* [PATCH v2] CI: migrate away from deprecated "set-output" syntax
  2022-12-06 20:00 [PATCH] CI: migrate away from deprecated "set-output" syntax Ævar Arnfjörð Bjarmason
  2022-12-06 20:50 ` Victoria Dye
@ 2022-12-07  1:49 ` Ævar Arnfjörð Bjarmason
  2022-12-07 23:57   ` Junio C Hamano
  2022-12-08  0:33   ` [PATCH v3] " Ævar Arnfjörð Bjarmason
  1 sibling, 2 replies; 9+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-12-07  1:49 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Victoria Dye, Taylor Blau,
	Ævar Arnfjörð Bjarmason

As noted in [1] and the warnings the CI itself is spewing echoing
outputs to stdout is deprecated, and they should be written to
"$GITHUB_OUTPUT" instead.

1. https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
Range-diff against v1:
1:  deb65805345 ! 1:  4e7db0db3be CI: migrate away from deprecated "set-output" syntax
    @@ Commit message
     
         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
     
    + ## .github/workflows/l10n.yml ##
    +@@ .github/workflows/l10n.yml: jobs:
    +             base=${{ github.event.before }}
    +             head=${{ github.event.after }}
    +           fi
    +-          echo "::set-output name=base::$base"
    +-          echo "::set-output name=head::$head"
    ++          cat >>$GITHUB_OUTPUT <<-EOF
    ++          base=$base
    ++          head=$head
    ++          EOF
    +       - name: Run partial clone
    +         run: |
    +           git -c init.defaultBranch=master init --bare .
    +
      ## .github/workflows/main.yml ##
     @@ .github/workflows/main.yml: jobs:
                then

 .github/workflows/l10n.yml | 6 ++++--
 .github/workflows/main.yml | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/l10n.yml b/.github/workflows/l10n.yml
index 27f72f0ff34..8fa073db2dc 100644
--- a/.github/workflows/l10n.yml
+++ b/.github/workflows/l10n.yml
@@ -23,8 +23,10 @@ jobs:
             base=${{ github.event.before }}
             head=${{ github.event.after }}
           fi
-          echo "::set-output name=base::$base"
-          echo "::set-output name=head::$head"
+          cat >>$GITHUB_OUTPUT <<-EOF
+          base=$base
+          head=$head
+          EOF
       - name: Run partial clone
         run: |
           git -c init.defaultBranch=master init --bare .
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 9afacfa0b33..d1e16009b11 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -34,7 +34,7 @@ jobs:
           then
             enabled=no
           fi
-          echo "::set-output name=enabled::$enabled"
+          echo "enabled=$enabled" >>$GITHUB_OUTPUT
       - name: skip if the commit or tree was already tested
         id: skip-if-redundant
         uses: actions/github-script@v6
-- 
2.39.0.rc2.1019.gce04d262ea9


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

* Re: [PATCH v2] CI: migrate away from deprecated "set-output" syntax
  2022-12-07  1:49 ` [PATCH v2] " Ævar Arnfjörð Bjarmason
@ 2022-12-07 23:57   ` Junio C Hamano
  2022-12-08  0:27     ` Ævar Arnfjörð Bjarmason
  2022-12-08  0:33   ` [PATCH v3] " Ævar Arnfjörð Bjarmason
  1 sibling, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2022-12-07 23:57 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Victoria Dye, Taylor Blau

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

>     +-          echo "::set-output name=base::$base"
>     +-          echo "::set-output name=head::$head"
>     ++          cat >>$GITHUB_OUTPUT <<-EOF
>     ++          base=$base
>     ++          head=$head
>     ++          EOF

Hmph, I do not trust this part.

The redirection operator "<<-" causes the leading tabs in the
here-doc-text stripped, but the .yml file does not indent with tab
to begin with.

I suspect the leading spaces will all be stripped and not seen by
the shell, so the distinction may not matter, which means the use of
"<<-" is very much misleading.

Let's stick to the dumb and proven

	echo "base=$base" >>$GITHUB_OUTPUT
	echo "head=$head" >>$GITHUB_OUTPUT

instead, which is used throughout the rewrite in this patch.


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

* Re: [PATCH v2] CI: migrate away from deprecated "set-output" syntax
  2022-12-07 23:57   ` Junio C Hamano
@ 2022-12-08  0:27     ` Ævar Arnfjörð Bjarmason
  2022-12-08  5:41       ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-12-08  0:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Victoria Dye, Taylor Blau


On Thu, Dec 08 2022, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>>     +-          echo "::set-output name=base::$base"
>>     +-          echo "::set-output name=head::$head"
>>     ++          cat >>$GITHUB_OUTPUT <<-EOF
>>     ++          base=$base
>>     ++          head=$head
>>     ++          EOF
>
> Hmph, I do not trust this part.
>
> The redirection operator "<<-" causes the leading tabs in the
> here-doc-text stripped, but the .yml file does not indent with tab
> to begin with.
>
> I suspect the leading spaces will all be stripped and not seen by
> the shell, so the distinction may not matter, which means the use of
> "<<-" is very much misleading.
>
> Let's stick to the dumb and proven
>
> 	echo "base=$base" >>$GITHUB_OUTPUT
> 	echo "head=$head" >>$GITHUB_OUTPUT
>
> instead, which is used throughout the rewrite in this patch.

Sure, I'll re-roll with that.

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

* [PATCH v3] CI: migrate away from deprecated "set-output" syntax
  2022-12-07  1:49 ` [PATCH v2] " Ævar Arnfjörð Bjarmason
  2022-12-07 23:57   ` Junio C Hamano
@ 2022-12-08  0:33   ` Ævar Arnfjörð Bjarmason
  1 sibling, 0 replies; 9+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-12-08  0:33 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Johannes Schindelin, Victoria Dye, Taylor Blau,
	Ævar Arnfjörð Bjarmason

As noted in [1] and the warnings the CI itself is spewing echoing
outputs to stdout is deprecated, and they should be written to
"$GITHUB_OUTPUT" instead.

1. https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
Range-diff against v2:
1:  4e7db0db3be ! 1:  0519cc1105a CI: migrate away from deprecated "set-output" syntax
    @@ .github/workflows/l10n.yml: jobs:
                fi
     -          echo "::set-output name=base::$base"
     -          echo "::set-output name=head::$head"
    -+          cat >>$GITHUB_OUTPUT <<-EOF
    -+          base=$base
    -+          head=$head
    -+          EOF
    ++          echo "base=$base" >>$GITHUB_OUTPUT
    ++          echo "head=$head" >>$GITHUB_OUTPUT
            - name: Run partial clone
              run: |
                git -c init.defaultBranch=master init --bare .

 .github/workflows/l10n.yml | 4 ++--
 .github/workflows/main.yml | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/l10n.yml b/.github/workflows/l10n.yml
index 27f72f0ff34..2915c595b4f 100644
--- a/.github/workflows/l10n.yml
+++ b/.github/workflows/l10n.yml
@@ -23,8 +23,8 @@ jobs:
             base=${{ github.event.before }}
             head=${{ github.event.after }}
           fi
-          echo "::set-output name=base::$base"
-          echo "::set-output name=head::$head"
+          echo "base=$base" >>$GITHUB_OUTPUT
+          echo "head=$head" >>$GITHUB_OUTPUT
       - name: Run partial clone
         run: |
           git -c init.defaultBranch=master init --bare .
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 9afacfa0b33..d1e16009b11 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -34,7 +34,7 @@ jobs:
           then
             enabled=no
           fi
-          echo "::set-output name=enabled::$enabled"
+          echo "enabled=$enabled" >>$GITHUB_OUTPUT
       - name: skip if the commit or tree was already tested
         id: skip-if-redundant
         uses: actions/github-script@v6
-- 
2.39.0.rc2.1019.gce04d262ea9


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

* Re: [PATCH v2] CI: migrate away from deprecated "set-output" syntax
  2022-12-08  0:27     ` Ævar Arnfjörð Bjarmason
@ 2022-12-08  5:41       ` Junio C Hamano
  0 siblings, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2022-12-08  5:41 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Victoria Dye, Taylor Blau

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

>> Let's stick to the dumb and proven
>>
>> 	echo "base=$base" >>$GITHUB_OUTPUT
>> 	echo "head=$head" >>$GITHUB_OUTPUT
>>
>> instead, which is used throughout the rewrite in this patch.
>
> Sure, I'll re-roll with that.

Ah, no need.  I've already amended the one under discussion and it
is in 'next' together with the last bit from Johannes to use the
updated upload/download artifact Action.

Thanks.

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

end of thread, other threads:[~2022-12-08  5:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-06 20:00 [PATCH] CI: migrate away from deprecated "set-output" syntax Ævar Arnfjörð Bjarmason
2022-12-06 20:50 ` Victoria Dye
2022-12-06 21:08   ` Ævar Arnfjörð Bjarmason
2022-12-07  0:56     ` Taylor Blau
2022-12-07  1:49 ` [PATCH v2] " Ævar Arnfjörð Bjarmason
2022-12-07 23:57   ` Junio C Hamano
2022-12-08  0:27     ` Ævar Arnfjörð Bjarmason
2022-12-08  5:41       ` Junio C Hamano
2022-12-08  0:33   ` [PATCH v3] " Ævar Arnfjörð Bjarmason

Code repositories for project(s) associated with this public 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).