Skip to content

Commit fefbf49

Browse files
authored
chore(ci): only run when certain files are changed (#7783)
1 parent 1f9c6e4 commit fefbf49

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

.github/workflows/publish-packages.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
name: Publish Packages
22

3-
# This workflow publishes packages to NPM when changes are merged to main branch or when manually triggered.
4-
# It runs automatically after successful tests or can be run manually for specific packages.
3+
# This workflow publishes packages to npm when changes are merged to main branch or when manually triggered.
54

65
on:
7-
workflow_run:
8-
# Only run after linting and tests have passed on main branch
9-
workflows: ['Linting and Tests']
10-
types: [completed]
6+
push:
7+
paths:
8+
- 'packages/**'
119
# For security reasons, this should never be set to anything but `main`
1210
branches: [main]
1311
workflow_dispatch:
@@ -21,17 +19,11 @@ permissions:
2119
contents: read
2220

2321
env:
24-
# Use the SHA from the workflow run that triggered this or the current SHA for manual runs
25-
COMMIT_SHA: ${{ github.event.workflow_run.head_sha || github.sha }}
22+
COMMIT_SHA: ${{ github.sha }}
2623

2724
jobs:
2825
prepare-packages:
2926
runs-on: ubuntu-latest
30-
# Only run if manually triggered or if the triggering workflow succeeded from a push event
31-
if: github.event_name == 'workflow_dispatch' || (
32-
github.event.workflow_run.conclusion == 'success' &&
33-
github.event.workflow_run.event == 'push' &&
34-
github.repository == 'nodejs/nodejs.org')
3527
outputs:
3628
# Output the matrix of packages to publish for use in the publish job
3729
matrix: ${{ steps.generate-matrix.outputs.matrix }}

0 commit comments

Comments
 (0)