Skip to content

Commit 8f13bd3

Browse files
committed
use artifacts
1 parent fd1eae1 commit 8f13bd3

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

.github/workflows/test.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ on:
1111
jobs:
1212
compile:
1313
runs-on: ubuntu-latest
14-
outputs:
15-
compilation_outputs: ${{ steps.compile.outputs.result }}
1614
steps:
1715
- uses: actions/checkout@v4
1816
- run: |
19-
echo "result=<<EOF" >> $GITHUB_OUTPUT
20-
g++ -o test source.cpp 2>&1 >> $GITHUB_OUTPUT
21-
echo "EOF" >> $GITHUB_OUTPUT
22-
id: compile
17+
g++ -o test source.cpp 2>&1 > compilation.log
18+
- uses: actions/upload-artifact@v3
19+
with:
20+
name: compilation_log
21+
path: compilation.log
2322
- run: ./test
2423

2524
test:
@@ -33,7 +32,9 @@ jobs:
3332
node-version: 20
3433
- run: npm install
3534
- run: npm run build
35+
- uses: actions/download-artifact@v3
36+
with:
37+
name: compilation_log
3638
- run: node dist/index.js
3739
env:
3840
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39-
COMPILATION_OUTPUTS: ${{ needs.compile.outputs.compilation_outputs }}

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { Octokit } from "@octokit/action";
2+
import { readFileSync } from "fs";
23

34
const octokit = new Octokit();
45

56
const [owner, repo] = process.env.GITHUB_REPOSITORY?.split("/")!;
67
const pull_request_number = parseInt(process.env.GITHUB_REF?.split("/")[2]!);
7-
const compilation_output = process.env.COMPILATION_OUTPUT!;
8-
8+
const compilation_output = readFileSync("compilation.log");
99
const { data: pullRequest } = await octokit.rest.pulls.get({
1010
owner,
1111
repo,

0 commit comments

Comments
 (0)