Skip to content

Commit

Permalink
chore: 🤖 skip changeset CI/CD when no changes
Browse files Browse the repository at this point in the history
chore: 🤖 skip changeset CI/CD when no changes

chore: 🤖 skip changeset CI/CD when no changes

chore: 🤖 skip changeset CI/CD when no changes

chore: 🤖 skip changeset CI/CD when no changes
  • Loading branch information
heldrida committed Jun 26, 2024
1 parent 68d8abe commit 5fda593
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/changeset-handler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,23 @@ jobs:
node-version: 20
cache: 'pnpm'

- name: Changeset status
id: changeset-status
shell: bash
run: |
if ! pnpm changeset:status &>/dev/null; then
echo "⚠️ Warning: No changesets found, should skip!"
echo "skip=true" >> "$GITHUB_OUTPUT"
fi
- name: Get pnpm store directory
if: ${{ steps.changeset-status.outputs.skip != 'true' }}
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
if: ${{ steps.changeset-status.outputs.skip != 'true' }}
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
Expand All @@ -50,16 +61,19 @@ jobs:
${{ runner.os }}-pnpm-store-
- name: Install dependencies
if: ${{ steps.changeset-status.outputs.skip != 'true' }}
run: |
pnpm install \
--strict-peer-dependencies
- name: Set version
if: ${{ steps.changeset-status.outputs.skip != 'true' }}
run: |
pnpm changeset:version
git status --short
- name: Commit changes
if: ${{ steps.changeset-status.outputs.skip != 'true' }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"build:ci": "pnpm run build",
"bundle": "ts-node -r dotenv/config bundle.ts",
"changeset:add": "npx changeset",
"changeset:add": "npx changeset status",
"changeset:version": "pnpm exec changeset version",
"clean": "pnpm \"/^clean:.*/\"",
"clean:dist": "rm -rf dist",
Expand Down

0 comments on commit 5fda593

Please sign in to comment.