Skip to content

Commit e81158a

Browse files
committed
Use new output setter using the correct environment variable
1 parent ea6e8d8 commit e81158a

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

action.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,11 @@ runs:
5050
DOWNLOAD=$GITHUB_ACTION_PATH/src/Download.java
5151
if [ ! -z "${{ inputs.uri }}" ]; then
5252
$JAVA \
53-
-DeprecatedSetOutput=true \
5453
-Dinstall-as-version="${{ inputs.install-as-version }}" \
5554
$DOWNLOAD \
5655
${{ inputs.uri }}
5756
else
5857
$JAVA \
59-
-DeprecatedSetOutput=true \
6058
-Dinstall-as-version="${{ inputs.install-as-version }}" \
6159
$DOWNLOAD \
6260
${{ inputs.website }} \

src/Download.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,19 +230,15 @@ Optional<String> findRemoteChecksum(String checksum) throws Exception {
230230
static class GitHub {
231231
/** Sets an action's output parameter. */
232232
static void setOutput(String name, Object value) {
233-
if (Boolean.getBoolean(/*-D*/ "eprecatedSetOutput")) {
234-
System.out.printf("::set-output name=%s::%s%n", name, value);
235-
return;
236-
}
237233
if (name.isBlank() || value.toString().isBlank()) { // implicit null checks included
238234
throw new IllegalArgumentException("name or value are blank: " + name + "=" + value);
239235
}
240-
var githubEnv = System.getenv("GITHUB_ENV");
241-
if (githubEnv == null) {
242-
throw new AssertionError("No such environment variable: GITHUB_ENV");
236+
var githubOutput = System.getenv("GITHUB_OUTPUT");
237+
if (githubOutput == null) {
238+
throw new AssertionError("No such environment variable: GITHUB_OUTPUT");
243239
}
244240
try {
245-
var file = Path.of(githubEnv);
241+
var file = Path.of(githubOutput);
246242
if (file.getParent() != null) Files.createDirectories(file.getParent());
247243
var lines = (name + "=" + value).lines().toList();
248244
if (lines.size() != 1) {

0 commit comments

Comments
 (0)