From 827e4e53d5302a68843e98e25e60656e9fcacd89 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 25 Jan 2024 00:37:26 +0100 Subject: [PATCH] Replace deprecated set-output command in Github Actions workflows (#1869) --- .github/workflows/release.yaml | 2 +- bin/package | 4 ++-- bin/ref-type/src/main.rs | 2 +- bin/ref-type/tests/integration.rs | 14 ++++---------- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a55956ad..9fff9902 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -70,7 +70,7 @@ jobs: - name: Ref Type id: ref-type - run: cargo run --package ref-type -- --reference ${{ github.ref }} + run: cargo run --package ref-type -- --reference ${{ github.ref }} >> $GITHUB_OUTPUT - name: Package id: package diff --git a/bin/package b/bin/package index bac0596c..c855ddbf 100755 --- a/bin/package +++ b/bin/package @@ -37,11 +37,11 @@ case $OS in ubuntu-latest | macos-latest) ARCHIVE=$DIST/just-$VERSION-$TARGET.tar.gz tar czf $ARCHIVE * - echo "::set-output name=archive::$ARCHIVE" + echo "archive=$ARCHIVE" >> $GITHUB_OUTPUT ;; windows-latest) ARCHIVE=$DIST/just-$VERSION-$TARGET.zip 7z a $ARCHIVE * - echo "::set-output name=archive::`pwd -W`/just-$VERSION-$TARGET.zip" + echo "archive=`pwd -W`/just-$VERSION-$TARGET.zip" >> $GITHUB_OUTPUT ;; esac diff --git a/bin/ref-type/src/main.rs b/bin/ref-type/src/main.rs index aafd66c0..963d1356 100644 --- a/bin/ref-type/src/main.rs +++ b/bin/ref-type/src/main.rs @@ -21,5 +21,5 @@ fn main() { eprintln!("ref: {}", arguments.reference); eprintln!("value: {value}"); - println!("::set-output name=value::{value}"); + println!("value={value}"); } diff --git a/bin/ref-type/tests/integration.rs b/bin/ref-type/tests/integration.rs index 1675f561..99b378cf 100644 --- a/bin/ref-type/tests/integration.rs +++ b/bin/ref-type/tests/integration.rs @@ -16,29 +16,23 @@ fn stdout(reference: &str) -> String { #[test] fn junk_is_other() { - assert_eq!(stdout("refs/tags/asdf"), "::set-output name=value::other\n"); + assert_eq!(stdout("refs/tags/asdf"), "value=other\n"); } #[test] fn valid_version_is_release() { - assert_eq!( - stdout("refs/tags/0.0.0"), - "::set-output name=value::release\n" - ); + assert_eq!(stdout("refs/tags/0.0.0"), "value=release\n"); } #[test] fn valid_version_with_trailing_characters_is_other() { - assert_eq!( - stdout("refs/tags/0.0.0-rc1"), - "::set-output name=value::other\n" - ); + assert_eq!(stdout("refs/tags/0.0.0-rc1"), "value=other\n"); } #[test] fn valid_version_with_lots_of_digits_is_release() { assert_eq!( stdout("refs/tags/01232132.098327498374.43268473849734"), - "::set-output name=value::release\n" + "value=release\n" ); }