From 17bc23954a5b2519e79354c710d4fe20643bad33 Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Mon, 7 Nov 2022 22:26:56 +0000 Subject: [PATCH] set-output is deprecated https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ --- .github/workflows/CoverageCollection.yml | 8 ++++++-- .github/workflows/Parameters.yml | 9 +++++++-- .github/workflows/Release.yml | 8 +++++--- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/CoverageCollection.yml b/.github/workflows/CoverageCollection.yml index e4d9174..7161a39 100644 --- a/.github/workflows/CoverageCollection.yml +++ b/.github/workflows/CoverageCollection.yml @@ -79,6 +79,7 @@ jobs: id: getVariables shell: python run: | + from os import environ from pathlib import Path from tomli import load as tomli_load @@ -110,8 +111,11 @@ jobs: else: print(f"File '{coverageRCFile}' not found.") - print(f"::set-output name=coverage_report_html_directory::{htmlDirectory}") - print(f"::set-output name=coverage_report_xml::{xmlFile}") + with open(environ['GITHUB_OUTPUT'], 'a', encoding='utf-8') as gho: + gho.write(f"""\ + coverage_report_html_directory={htmlDirectory} + coverage_report_xml={xmlFile} + """) print(f"DEBUG:\n html={htmlDirectory}\n xml={xmlFile}") - name: Collect coverage diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index af22323..2db2c26 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -65,6 +65,8 @@ jobs: id: params shell: python run: | + from os import environ + name = '${{ inputs.name }}' params = { 'python_version': '${{ inputs.python_version }}', @@ -76,7 +78,9 @@ jobs: 'doc': f'{name}-doc', } } - print(f'::set-output name=params::{params!s}') + + with open(environ['GITHUB_OUTPUT'], 'a', encoding='utf-8') as gho: + gho.write(f"params={params!s}\n") print("Parameters:") print(params) @@ -114,6 +118,7 @@ jobs: for system in systems for version in (versions if system != 'msys2' else ['3.10']) ] - print(f'::set-output name=python_jobs::{jobs!s}') + with open(environ['GITHUB_OUTPUT'], 'a', encoding='utf-8') as gho: + gho.write(f"python_jobs={jobs!s}\n") print("Python jobs:") print(jobs) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index cae3b0b..6d82182 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -39,9 +39,11 @@ jobs: RELEASE_VERSION=${GIT_TAG#v} RELEASE_DATETIME="$(date --utc '+%d.%m.%Y - %H:%M:%S')" # write to step outputs - echo ::set-output name=gitTag::${GIT_TAG} - echo ::set-output name=version::${RELEASE_VERSION} - echo ::set-output name=datetime::${RELEASE_DATETIME} + cat >> "$GITHUB_OUTPUT" << EOF + gitTag=${GIT_TAG} + version=${RELEASE_VERSION} + datetime=${RELEASE_DATETIME} + EOF - name: 📑 Create Release Page id: createReleasePage