diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 24c5e0eb..450cbb59 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -1,41 +1,36 @@ name: Auto Release on: - push: + pull_request: + types: [closed] branches: - main jobs: release: - name: Run release-it + if: github.event.pull_request.merged == true runs-on: ubuntu-latest permissions: contents: write steps: - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Install pnpm - uses: pnpm/action-setup@v4 + - uses: pnpm/action-setup@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 + - uses: actions/setup-node@v4 with: node-version: "lts/*" cache: "pnpm" - - name: Install dependencies - run: pnpm install --frozen-lockfile + - run: pnpm install --frozen-lockfile - - name: Configure Git User - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' + - run: git config --global user.name 'github-actions[bot]' + - run: git config --global user.email 'github-actions[bot]@users.noreply.github.com' - name: Run release-it env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: pnpm exec release-it --ci + run: pnpm exec release-it --ci --no-git.push --no-git.commit