Skip to content

Commit ea6e8d8

Browse files
committed
Revert to use deprecated set-output for the time being
1 parent 6dd0cff commit ea6e8d8

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,13 @@ runs:
5050
DOWNLOAD=$GITHUB_ACTION_PATH/src/Download.java
5151
if [ ! -z "${{ inputs.uri }}" ]; then
5252
$JAVA \
53+
-DeprecatedSetOutput=true \
5354
-Dinstall-as-version="${{ inputs.install-as-version }}" \
5455
$DOWNLOAD \
5556
${{ inputs.uri }}
5657
else
5758
$JAVA \
59+
-DeprecatedSetOutput=true \
5860
-Dinstall-as-version="${{ inputs.install-as-version }}" \
5961
$DOWNLOAD \
6062
${{ inputs.website }} \

src/Download.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ 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+
}
233237
if (name.isBlank() || value.toString().isBlank()) { // implicit null checks included
234238
throw new IllegalArgumentException("name or value are blank: " + name + "=" + value);
235239
}
@@ -244,6 +248,7 @@ static void setOutput(String name, Object value) {
244248
if (lines.size() != 1) {
245249
throw new UnsupportedOperationException("Multiline strings are no supported");
246250
}
251+
debug("Write output %s to %s".formatted(lines, file));
247252
Files.write(file, lines, UTF_8, CREATE, APPEND, WRITE);
248253
} catch (IOException exception) {
249254
throw new UncheckedIOException(exception);

0 commit comments

Comments
 (0)