Skip to content

Fix: Run pkg.pr.new only if there are changes #656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 27, 2024
8 changes: 8 additions & 0 deletions .github/workflows/pkg.pr.new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Check for changes to nuqs package
id: check-for-changes
run: |
if git diff --quiet ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} ./packages/nuqs; then
echo "No changes to nuqs package, skipping preview deployment."
echo "skip=true" >> $GITHUB_OUTPUT
fi
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
Expand All @@ -25,4 +32,5 @@ jobs:
run: pnpm pkg set version=0.0.0-preview.${{ github.event.pull_request.head.sha }}
working-directory: packages/nuqs
- name: Publish to pkg.pr.new
if: steps.check-for-changes.outputs.skip != 'true'
run: pnpx pkg-pr-new publish --compact './packages/nuqs'