Skip to content

Commit

Permalink
Refine GitHub Actions workflow trigger conditions
Browse files Browse the repository at this point in the history
- Add paths-ignore to the publish workflow
- Ignore changes to non-TS, non-JSON, and non-lock files
- Exclude changes in the .vscode folder from triggering the workflow
- This optimization reduces unnecessary workflow runs and focuses on
  relevant code changes
  • Loading branch information
codybrom committed Sep 24, 2024
1 parent 6dd950c commit e703f67
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- main
paths-ignore:
- "**/*.!(ts|json|lock)"
- ".vscode/**"

jobs:
publish:
Expand All @@ -18,12 +21,12 @@ jobs:

- name: Publish package to JSR
run: npx jsr publish

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
node-version: "20.x"
registry-url: "https://registry.npmjs.org"

- name: Publish package to NPM
run: npm publish --provenance --access public
Expand Down

0 comments on commit e703f67

Please sign in to comment.