From 1a138d00d8f87a9f1d22ee44e30b1fee931cf4f0 Mon Sep 17 00:00:00 2001 From: SlightlyCircuitous <71394296+SlightlyCircuitous@users.noreply.github.com> Date: Tue, 5 Mar 2024 16:15:36 -0500 Subject: [PATCH 1/3] Replace set-output with GITHUB_OUTPUT Replaces all instances in echo commands --- .github/workflows/updateversion.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/updateversion.yml b/.github/workflows/updateversion.yml index 01e59c5..30ce2c0 100644 --- a/.github/workflows/updateversion.yml +++ b/.github/workflows/updateversion.yml @@ -51,11 +51,11 @@ jobs: UPSTREAM="$(jq -r ".base.repo.clone_url" "$tmp")" LINK="${{github.event.issue.html_url}}" fi - echo "::set-output name=link::$LINK" - echo "::set-output name=ref::$REF" - echo "::set-output name=page::$REPO_PAGE" - echo "::set-output name=name::$REPO_NAME" - echo "::set-output name=upstream::$UPSTREAM" + echo "link=$LINK" >> $GITHUB_OUTPUT + echo "ref=$REF" >> $GITHUB_OUTPUT + echo "page=$REPO_PAGE" >> $GITHUB_OUTPUT + echo "name=$REPO_NAME" >> $GITHUB_OUTPUT + echo "upstream=$UPSTREAM" >> $GITHUB_OUTPUT - name: Checkout pull request uses: actions/checkout@v4 @@ -79,9 +79,9 @@ jobs: echo "::notice::you can resolve merge conflicts at $LINK/conflicts" exit 2 elif git diff --quiet FETCH_HEAD tokens.xml; then - echo "::set-output name=update::false" + echo "update=false" >> $GITHUB_OUTPUT else - echo "::set-output name=update::true" + echo "update=true" >> $GITHUB_OUTPUT fi - name: Get date @@ -93,8 +93,8 @@ jobs: previous="$(> $GITHUB_OUTPUT + echo "previous=$previous" >> $GITHUB_OUTPUT - name: Check for suffix used when multiple changes happen in a day if: steps.check.outputs.update == 'true' From ecb3b5f092103ec6db9947486a40976e141747e2 Mon Sep 17 00:00:00 2001 From: SlightlyCircuitous <71394296+SlightlyCircuitous@users.noreply.github.com> Date: Sat, 9 Mar 2024 18:48:11 -0500 Subject: [PATCH 2/3] Replace set-output in python code --- .github/workflows/updateversion.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/updateversion.yml b/.github/workflows/updateversion.yml index 30ce2c0..a5be0b9 100644 --- a/.github/workflows/updateversion.yml +++ b/.github/workflows/updateversion.yml @@ -101,6 +101,7 @@ jobs: id: version shell: python run: | + import os import re previous = "${{steps.date.outputs.previous}}" date = "${{steps.date.outputs.date}}" @@ -124,7 +125,8 @@ jobs: else: charlist.append("a") version += "".join(reversed(charlist)) - print(f"::set-output name=version::{version}") + with open(os.environ['GITHUB_OUTPUT'], 'a') as envFile: + print(f"version={version}", file=envFile) - name: Update date in files if: steps.check.outputs.update == 'true' From 3b135c4e35d60d68ecad0a45af978ac66c3e3c3f Mon Sep 17 00:00:00 2001 From: SlightlyCircuitous <71394296+SlightlyCircuitous@users.noreply.github.com> Date: Sat, 9 Mar 2024 19:10:44 -0500 Subject: [PATCH 3/3] Use double quotes --- .github/workflows/updateversion.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/updateversion.yml b/.github/workflows/updateversion.yml index a5be0b9..768bacf 100644 --- a/.github/workflows/updateversion.yml +++ b/.github/workflows/updateversion.yml @@ -125,7 +125,7 @@ jobs: else: charlist.append("a") version += "".join(reversed(charlist)) - with open(os.environ['GITHUB_OUTPUT'], 'a') as envFile: + with open(os.environ["GITHUB_OUTPUT"], "a") as envFile: print(f"version={version}", file=envFile) - name: Update date in files