From a357a77b0f0b36f8830a563aa42c7ed622a83067 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 21 Oct 2022 11:33:42 +0900 Subject: [PATCH] fix: use GITHUB_OUTPUT instead of deprecated set-output command (#1066) Same as https://github.com/slsa-framework/slsa-github-generator/pull/1061 - https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ - https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter Co-authored-by: Ian Lewis --- .../pre-submit.e2e.go.config-ldflags-main-dir.yml | 6 +++--- internal/builders/go/README.md | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pre-submit.e2e.go.config-ldflags-main-dir.yml b/.github/workflows/pre-submit.e2e.go.config-ldflags-main-dir.yml index e27a575b62..1f7b5d961c 100644 --- a/.github/workflows/pre-submit.e2e.go.config-ldflags-main-dir.yml +++ b/.github/workflows/pre-submit.e2e.go.config-ldflags-main-dir.yml @@ -22,9 +22,9 @@ jobs: run: | set -euo pipefail - echo "::set-output name=version::-X main.gitVersion=v1.2.3" - echo "::set-output name=commit::-X main.gitCommit=abcdef" - echo "::set-output name=branch::-X main.gitBranch=main" + echo "version=-X main.gitVersion=v1.2.3" >> "$GITHUB_OUTPUT" + echo "commit=-X main.gitCommit=abcdef" >> "$GITHUB_OUTPUT" + echo "branch=-X main.gitBranch=main" >> "$GITHUB_OUTPUT" build: needs: [args] diff --git a/internal/builders/go/README.md b/internal/builders/go/README.md index 98a67cd8dd..3606083f71 100644 --- a/internal/builders/go/README.md +++ b/internal/builders/go/README.md @@ -165,10 +165,10 @@ jobs: fetch-depth: 0 - id: ldflags run: | - echo "::set-output name=commit-date::$(git log --date=iso8601-strict -1 --pretty=%ct)" - echo "::set-output name=commit::$GITHUB_SHA" - echo "::set-output name=version::$(git describe --tags --always --dirty | cut -c2-)" - echo "::set-output name=tree-state::$(if git diff --quiet; then echo "clean"; else echo "dirty"; fi)" + echo "commit-date=$(git log --date=iso8601-strict -1 --pretty=%ct)" >> "$GITHUB_OUTPUT" + echo "commit=$GITHUB_SHA" >> "$GITHUB_OUTPUT" + echo "version=$(git describe --tags --always --dirty | cut -c2-)" >> "$GITHUB_OUTPUT" + echo "tree-state=$(if git diff --quiet; then echo "clean"; else echo "dirty"; fi)" >> "$GITHUB_OUTPUT" # Trusted builder. build: