public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Eugene Rozenfeld <erozen@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/vendors/microsoft/heads/main)] Use environment files instead of set-output command
Date: Thu, 27 Apr 2023 23:38:05 +0000 (GMT)	[thread overview]
Message-ID: <20230427233805.C75B73858C66@sourceware.org> (raw)

https://gcc.gnu.org/g:a63acbd79bbfc484995c767ae56865cc1b3fd0d5

commit a63acbd79bbfc484995c767ae56865cc1b3fd0d5
Author: Eugene Rozenfeld <erozen@microsoft.com>
Date:   Wed Apr 26 19:14:09 2023 -0700

    Use environment files instead of set-output command
    
    set-output command has been deprecated.

Diff:
---
 .github/scripts/config.py                     | 11 +++++++++--
 .github/scripts/gccWorkflow.py                |  6 +++++-
 .github/workflows/update-main.yaml            |  4 ++--
 .github/workflows/update-mirror-branches.yaml |  2 +-
 4 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/.github/scripts/config.py b/.github/scripts/config.py
index 709e340c4cc..53781ead4a7 100755
--- a/.github/scripts/config.py
+++ b/.github/scripts/config.py
@@ -26,6 +26,7 @@ import globals
 from common import *
 from downloadBuildArtifact import *
 import sys
+import os
 
 # subclass JSONEncoder to convert the Config object into JSON
 class ConfigEncoder(JSONEncoder):
@@ -73,7 +74,10 @@ class Config(object):
         configJson = json.dumps(newConfig, cls=ConfigEncoder)
 
         # Output for Github to pick up output for future steps
-        print("::set-output name=configJson::" + configJson)
+        name = 'configJson'
+        value = configJson
+        with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
+            print(f'{name}={value}', file=fh)
 
         # Set global config object
         globals.configObj = newConfig
@@ -88,7 +92,10 @@ class Config(object):
         configJson = json.dumps(globals.configObj, cls=ConfigEncoder)
 
         # Output for Github to pick up output for future jobs
-        print("::set-output name=noSecretConfigJson::" + configJson)
+        name = 'noSecretConfigJson'
+        value = configJson
+        with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
+            print(f'{name}={value}', file=fh)
 
     @staticmethod
     def PrintNoSecretConfigJsonFromJson(configJson):
diff --git a/.github/scripts/gccWorkflow.py b/.github/scripts/gccWorkflow.py
index 411aac30434..585a99a140d 100755
--- a/.github/scripts/gccWorkflow.py
+++ b/.github/scripts/gccWorkflow.py
@@ -43,7 +43,11 @@ class GccWorkflow(object):
             "testSet" : ["check-target-libstdc++-v3", "check-gcc-c++", "check-gcc-c", "check-target-libgomp", "check-target-libitm", "check-target-libatomic"]
         }
         dictionaryJson = json.dumps(dictionary)
-        print("::set-output name=testSet::" + dictionaryJson)
+
+        name = 'testSet'
+        value = dictionaryJson
+        with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
+            print(f'{name}={value}', file=fh)
 
     # Runs the configure script to set up gcc configuration environment prior to building and running tests
     # Creates the objdir directory as part of this process
diff --git a/.github/workflows/update-main.yaml b/.github/workflows/update-main.yaml
index 79fd829fa5c..fd9804d629d 100644
--- a/.github/workflows/update-main.yaml
+++ b/.github/workflows/update-main.yaml
@@ -263,11 +263,11 @@ jobs:
 
       - name: Get current date
         id: date
-        run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H-%M-%S')"
+        run: echo "date=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_OUTPUT
 
       - name: Set new branch name
         id: setBranchName
-        run: echo "::set-output name=newBranchName::${name}"
+        run: echo "newBranchName=${name}" >> $GITHUB_OUTPUT
         env:
           name: merge-master-${{ needs.gcc-master-build.outputs.masterSHA }}-${{ steps.date.outputs.date }}
 
diff --git a/.github/workflows/update-mirror-branches.yaml b/.github/workflows/update-mirror-branches.yaml
index cc7b56fb7f0..baba7ada092 100644
--- a/.github/workflows/update-mirror-branches.yaml
+++ b/.github/workflows/update-mirror-branches.yaml
@@ -79,7 +79,7 @@ jobs:
 
       - name: Get current date
         id: date
-        run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H-%M-%S')"
+        run: echo "date=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_OUTPUT
 
       - name: Push to branch in GitHub repo
         run: |

             reply	other threads:[~2023-04-27 23:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 23:38 Eugene Rozenfeld [this message]
2023-05-02 23:18 Eugene Rozenfeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230427233805.C75B73858C66@sourceware.org \
    --to=erozen@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).