Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions: Remove deprecated set-output command #1869

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bin/package
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion bin/ref-type/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ fn main() {
eprintln!("ref: {}", arguments.reference);
eprintln!("value: {value}");

println!("::set-output name=value::{value}");
println!("value={value}");
}
14 changes: 4 additions & 10 deletions bin/ref-type/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
}