Skip to content

Commit 4bc910e

Browse files
committed
chore: set up workflow inputs
1 parent f7997bf commit 4bc910e

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

.github/workflows/branch.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
name: Check
3232
needs: [install]
3333
uses: ./.github/workflows/checks.yml
34+
with:
35+
ref: ${{ github.sha }}
3436

3537
# The security job can't run on pull requests opened from forks because
3638
# Github doesn't pass down the SNYK_TOKEN environment variable.

.github/workflows/checks.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: v4.x checks
22

3-
on: [workflow_call]
3+
on:
4+
workflow_call:
5+
inputs:
6+
ref:
7+
description: 'The commit the workflow should check out'
8+
required: true
9+
default: ${{ github.sha }}
10+
type: string
411

512
jobs:
613
test-node:
@@ -14,7 +21,7 @@ jobs:
1421
steps:
1522
- uses: actions/checkout@v3
1623
with:
17-
ref: ${{ github.sha }}
24+
ref: ${{ inputs.ref }}
1825
- uses: actions/cache@v3
1926
with:
2027
path: ~/.npm # this is cache where npm installs from before going out to the network
@@ -31,6 +38,8 @@ jobs:
3138
runs-on: ubuntu-latest
3239
steps:
3340
- uses: actions/checkout@v3
41+
with:
42+
ref: ${{ inputs.ref }}
3443
- uses: actions/cache@v3
3544
with:
3645
path: ~/.npm # this is cache where npm installs from before going out to the network
@@ -47,6 +56,8 @@ jobs:
4756
runs-on: ubuntu-latest
4857
steps:
4958
- uses: actions/checkout@v3
59+
with:
60+
ref: ${{ inputs.ref }}
5061
- uses: actions/cache@v3
5162
with:
5263
path: ~/.npm # this is cache where npm installs from before going out to the network
@@ -59,6 +70,8 @@ jobs:
5970
runs-on: ubuntu-latest
6071
steps:
6172
- uses: actions/checkout@v3
73+
with:
74+
ref: ${{ inputs.ref }}
6275
- uses: actions/cache@v3
6376
with:
6477
path: ~/.npm # this is cache where npm installs from before going out to the network

.github/workflows/pr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@ jobs:
4545
name: Checks
4646
needs: [install]
4747
uses: ./.github/workflows/checks.yml
48+
with:
49+
ref: ${{ github.event.pull_request.head.sha }}

0 commit comments

Comments
 (0)