From fc35d1a4b66232bbde1a4fdee7e592424fe2b88e Mon Sep 17 00:00:00 2001 From: Hunter Thornsberry Date: Wed, 28 Aug 2024 16:01:18 -0400 Subject: [PATCH] just check if master when checking version bumps --- .github/workflows/pr-master.yml | 56 --------------------------------- .github/workflows/pr.yml | 23 +++++++++++++- 2 files changed, 22 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/pr-master.yml diff --git a/.github/workflows/pr-master.yml b/.github/workflows/pr-master.yml deleted file mode 100644 index ebbaeec..0000000 --- a/.github/workflows/pr-master.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Pull Request - Master - -on: pull_request - branches: - - 'master' - -jobs: -quality: - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Biome - uses: biomejs/setup-biome@v1 - with: - version: latest - - - name: Run Biome - run: biome ci . # https://biomejs.dev/reference/cli/#biome-ci -build: - needs: quality - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup pnpm - uses: pnpm/action-setup@v2 - with: - version: latest - - - name: Install Dependencies - run: pnpm install - - - name: Build Package - run: pnpm build - - - name: Check if version has been updated - id: check-version-changed - uses: EndBug/version-check@v2 - with: - diff-search: true - - - name: Log when changed - if: steps.check-version-changed.outputs.changed == 'true' - run: | - echo "Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})" - - - name: Log when unchanged - if: steps.check-version-changed.outputs.changed == 'false' - run: | - echo "No version change. Please update the package version in package.json" - exit 1 \ No newline at end of file diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index dee3591..4607505 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -36,4 +36,25 @@ jobs: run: pnpm install - name: Build Package - run: pnpm build \ No newline at end of file + run: pnpm build + version-check: + needs: build + if: github.ref == 'refs/heads/master' + steps: + - name: Check if version has been updated + if: + id: check-version-changed + uses: EndBug/version-check@v2 + with: + diff-search: true + + - name: Log when changed + if: steps.check-version-changed.outputs.changed == 'true' + run: | + echo "Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})" + + - name: Log when unchanged + if: steps.check-version-changed.outputs.changed == 'false' + run: | + echo "No version change. Please update the package version in package.json" + exit 1 \ No newline at end of file