Skip to content

Commit a554d33

Browse files
authored
CI: replace deprecated set-output command with GITHUB_ENV (#5734)
1 parent f0ba004 commit a554d33

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,13 @@ jobs:
6969
run: opam exec -- node scripts/ciTest.js -mocha -theme -format
7070

7171
- name: Get artifact info
72-
id: get_artifact_info
7372
run: node .github/workflows/get_artifact_info.js
7473

7574
- name: "Upload artifacts: binaries"
7675
uses: actions/upload-artifact@v3
7776
with:
78-
name: ${{ steps.get_artifact_info.outputs.artifact_name }}
79-
path: ${{ steps.get_artifact_info.outputs.artifact_path }}
77+
name: ${{ env.artifact_name }}
78+
path: ${{ env.artifact_path }}
8079

8180
- name: "Upload artifacts: lib/ocaml"
8281
if: runner.os == 'Linux'
@@ -140,7 +139,6 @@ jobs:
140139
working-directory: packages/std
141140

142141
- name: Get package info
143-
id: get_package_info
144142
# For pull requests, pass the correct commit SHA explicitly as GITHUB_SHA points to the wrong commit.
145143
run: node .github/workflows/get_package_info.js ${{ github.event.pull_request.head.sha }}
146144

@@ -149,8 +147,8 @@ jobs:
149147
with:
150148
name: npm-packages
151149
path: |
152-
${{ steps.get_package_info.outputs.rescript_package }}
153-
${{ steps.get_package_info.outputs.stdlib_package }}
150+
${{ env.rescript_package }}
151+
${{ env.stdlib_package }}
154152
155153
installationTest:
156154
needs: package
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
const fs = require("fs");
2+
const os = require("os");
3+
14
const artifactPath =
25
process.platform === "darwin" && process.arch === "arm64"
36
? process.platform + process.arch
@@ -6,5 +9,7 @@ const artifactPath =
69
const artifactName = "binaries-" + artifactPath;
710

811
// Pass artifactPath and artifactName to subsequent GitHub actions
9-
console.log(`::set-output name=artifact_path::${artifactPath}`);
10-
console.log(`::set-output name=artifact_name::${artifactName}`);
12+
fs.appendFileSync(
13+
process.env.GITHUB_ENV,
14+
`artifact_path=${artifactPath}${os.EOL}artifact_name=${artifactName}${os.EOL}`
15+
);

.github/workflows/get_package_info.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const fs = require("fs");
2+
const os = require("os");
23

34
const packageSpec = JSON.parse(fs.readFileSync("./package.json", "utf8"));
45
const { name, version } = packageSpec;
@@ -16,5 +17,7 @@ fs.renameSync(rescriptPackagePath, rescriptArtifactName);
1617
fs.renameSync(stdlibPackagePath, stdlibArtifactName);
1718

1819
// Pass information to subsequent GitHub actions
19-
console.log(`::set-output name=rescript_package::${rescriptArtifactName}`);
20-
console.log(`::set-output name=stdlib_package::${stdlibArtifactName}`);
20+
fs.appendFileSync(
21+
process.env.GITHUB_ENV,
22+
`rescript_package=${rescriptArtifactName}${os.EOL}stdlib_package=${stdlibArtifactName}${os.EOL}`
23+
);

0 commit comments

Comments
 (0)