@@ -19,7 +19,7 @@ concurrency:
1919 group : ${{ github.workflow }}-${{ github.ref }}
2020 cancel-in-progress : true
2121jobs :
22- test-action :
22+ branch :
2323 permissions :
2424 contents : write
2525 strategy :
@@ -33,23 +33,63 @@ jobs:
3333 shell : bash
3434 steps :
3535 - uses : actions/checkout@v4
36+ - uses : oven-sh/setup-bun@v1
37+ - run : bun install
38+ # - run: bun run build
39+ 40+ - uses : actions/checkout@v4
41+ with :
42+ ref : test-branch
43+ path : test/branch
44+ - shell : bun {0}
45+ run : |
46+ import { readFile, writeFile } from "node:fs/promises";
47+ let number = JSON.parse(await readFile("number.txt", "utf8"))
48+ console.log("old number", number)
49+ number = Math.random();
50+ console.log("new number", number)
51+ await writeFile("number.txt", JSON.stringify(number))
52+ working-directory : test/branch
53+ - id : main
54+ uses : ./
3655 with :
37- ref : ${{ github.ref }}
56+ path : test/branch
57+ - shell : jq -C . {0}
58+ run : ${{ toJSON(steps.main.outputs) }}
59+ tag :
60+ permissions :
61+ contents : write
62+ strategy :
63+ max-parallel : 1
64+ fail-fast : false
65+ matrix :
66+ os : [ubuntu-latest, macos-latest]
67+ runs-on : ${{ matrix.os }}
68+ defaults :
69+ run :
70+ shell : bash
71+ steps :
72+ - uses : actions/checkout@v4
3873 - uses : oven-sh/setup-bun@v1
3974 - run : bun install
4075 # - run: bun run build
417677+ - uses : actions/checkout@v4
78+ with :
79+ ref : test-tag
80+ path : test/tag
4281 - shell : bun {0}
4382 run : |
4483 import { readFile, writeFile } from "node:fs/promises";
45- let number = JSON.parse(await readFile("test/ number.txt", "utf8"))
84+ let number = JSON.parse(await readFile("number.txt", "utf8"))
4685 console.log("old number", number)
4786 number = Math.random();
4887 console.log("new number", number)
49- await writeFile("test/number.txt", JSON.stringify(number))
88+ await writeFile("number.txt", JSON.stringify(number))
89+ working-directory : test/tag
5090 - id : main
5191 uses : ./
5292 with :
53- add-pathspec : test/number.txt
93+ path : test/tag
5494 - shell : jq -C . {0}
5595 run : ${{ toJSON(steps.main.outputs) }}
0 commit comments