git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] CI: migrate away from deprecated "set-output" syntax

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Dec 7, 2022, 01:49 UTC
Message-ID
<patch-v2-1.1-4e7db0db3be-20221207T014848Z-avarab@gmail.com>
In-Reply-To
<patch-1.1-deb65805345-20221206T195811Z-avarab@gmail.com>

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
Previous: Taylor BlauNext: Junio C Hamano
Message 5 of 9 in “CI: migrate away from deprecated "set-output" syntax”
  1. CI: migrate away from deprecated "set-output" syntaxÆvar Arnfjörð Bjarmason, Dec 6, 2022
  2. Victoria DyeDec 6, 2022
  3. Ævar Arnfjörð BjarmasonDec 6, 2022
  4. Taylor BlauDec 7, 2022
  5. CI: migrate away from deprecated "set-output" syntaxÆvar Arnfjörð Bjarmason, Dec 7, 2022
  6. Junio C HamanoDec 7, 2022
  7. Ævar Arnfjörð BjarmasonDec 8, 2022
  8. Junio C HamanoDec 8, 2022
  9. CI: migrate away from deprecated "set-output" syntaxÆvar Arnfjörð Bjarmason, Dec 8, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.