Skip to content

Commit b6badd1

Browse files
committed
build: only run job on main repo and not on forks
1 parent 2659818 commit b6badd1

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

.github/workflows/linux_test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ jobs:
5151
# Define a display name:
5252
name: "Node.js v${{ matrix.NODE_VERSION }}"
5353

54+
# Ensure the job does not run on forks:
55+
if: github.repository == 'stdlib-js/stdlib'
56+
5457
# Define the type of virtual host machine:
5558
runs-on: ${{ matrix.OS }}
5659

@@ -273,7 +276,7 @@ jobs:
273276
needs: test
274277

275278
# Run this job regardless of the outcome of the prior job:
276-
if: always()
279+
if: success() || failure()
277280

278281
# Set defaults:
279282
defaults:

.github/workflows/linux_test_install.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ jobs:
5151
# Define a display name:
5252
name: "Node.js v${{ matrix.NODE_VERSION }} - ${{ matrix.PACKAGE_MANAGER }}"
5353

54+
# Ensure the job does not run on forks:
55+
if: github.repository == 'stdlib-js/stdlib'
56+
5457
# Define the type of virtual host machine:
5558
runs-on: ${{ matrix.OS }}
5659

@@ -297,7 +300,7 @@ jobs:
297300
needs: test_install
298301

299302
# Run this job regardless of the outcome of the prior job:
300-
if: always()
303+
if: success() || failure()
301304

302305
# Set defaults:
303306
defaults:

.github/workflows/macos_test_npm_install.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ jobs:
5151
# Define a display name:
5252
name: "Node.js v${{ matrix.NODE_VERSION }}"
5353

54+
# Ensure the job does not run on forks:
55+
if: github.repository == 'stdlib-js/stdlib'
56+
5457
# Define the type of virtual host machine on which to run the job:
5558
runs-on: ${{ matrix.OS }}
5659

@@ -255,8 +258,8 @@ jobs:
255258
# Indicate that this job depends on the prior job finishing:
256259
needs: test_npm_install
257260

258-
# Always run this job regardless of the outcome of the prior job:
259-
if: always()
261+
# Run this job regardless of the outcome of the prior job:
262+
if: success() || failure()
260263

261264
# Set defaults:
262265
defaults:

0 commit comments

Comments
 (0)