diff --git a/.github/workflows/code-pull-request.yml b/.github/workflows/code-pull-request.yml index 7662fc9b..7a94ef2d 100644 --- a/.github/workflows/code-pull-request.yml +++ b/.github/workflows/code-pull-request.yml @@ -5,6 +5,8 @@ on: types: [opened, edited, synchronize, reopened] branches: - main + workflow_dispatch: + workflow_call: permissions: contents: read @@ -18,7 +20,7 @@ jobs: name: Validate Code runs-on: ubuntu-latest timeout-minutes: 10 - if: github.event.pull_request.draft == false + if: github.event_name != 'pull_request' || github.event.pull_request.draft == false steps: - name: Checkout code uses: actions/checkout@v4 @@ -38,6 +40,7 @@ jobs: - name: Install dependencies run: bun install --frozen-lockfile - name: Validate commit messages + if: github.event_name == 'pull_request' run: echo "${{ github.event.pull_request.title }}" | bun run commitlint - name: Validate id: validate diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2dc296db..bb751b99 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,6 +83,10 @@ jobs: workflow: pull-request github-token: ${{ github.token }} branch: release + validate-release-pr: + name: Validate release PR + needs: pull-request + uses: ./.github/workflows/code-pull-request.yml release: runs-on: ubuntu-latest timeout-minutes: 10