Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnrushefsky committed Jan 14, 2025
1 parent 7e517cb commit 5154db4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:

- name: Get the PR that was merged into main
id: pr-output
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
info=$(gh pr list --state merged --limit 1 --json title --json body)
echo "title=$(echo $info | jq -r '.title')" >> $GITHUB_OUTPUT
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ on:
branches:
- main
paths-ignore:
- ".github/**"
- "**.md"
- "**.png"
- ".gitignore"
- "generate-workflow"
- "**.yml"
- "test/**"
- "example-workflows/**"

Expand All @@ -21,6 +19,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: "Only run if last commit was a code change"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git diff-tree --no-commit-id --name-only -r HEAD | sort > changed_files
if ! (grep -q "^src/" changed_files || grep -q "^\.github/workflows/pr-build\.yml$" changed_files); then
echo "No changes in src/ directory or .github/workflows/pr-build.yml"
gh run cancel ${{ github.run_id }}
gh run watch ${{ github.run_id }}
fi
- name: Set up Node.js
uses: actions/setup-node@v4
with:
Expand Down

0 comments on commit 5154db4

Please sign in to comment.