From e48ceda5ae2ee37e09cece3f5dc2de16be981912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Silveira?= Date: Thu, 23 Apr 2026 16:29:26 +0200 Subject: [PATCH] Fix CI not running on pull requests targeting main MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `pull_request.branches` in ci.yml filtered on [feature/**, bugfix/**], which per GitHub Actions semantics matches the PR's base branch, not its source. Contributor PRs target main, so the workflow never fired and the test suite effectively didn't run on any PR. Point the filter at main so the workflow activates. The feature/bugfix naming intent is preserved by a new validate-pr-branch-name job that runs only on pull_request events and checks github.head_ref — the source branch, which is what the original filter was trying to reach. continuous-integration gains an explicit `always() && (success || skipped)` guard so it runs both when the validation passes (PR path) and when it is skipped (push and workflow_dispatch paths, where the validation job doesn't run). push: and workflow_dispatch: triggers are unchanged. --- .github/workflows/ci.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3125da8..f3b9a89 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,12 +12,28 @@ on: pull_request: branches: - - feature/** - - bugfix/** + - main jobs: + validate-pr-branch-name: + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + steps: + - name: Enforce PR branch naming convention + run: | + branch="${{ github.head_ref }}" + if [[ ! "$branch" =~ ^(feature|bugfix)/ ]]; then + echo "::error::PR branch must start with 'feature/' or 'bugfix/'. Got: $branch" + exit 1 + fi + continuous-integration: + needs: validate-pr-branch-name + if: | + always() && + (needs.validate-pr-branch-name.result == 'success' || + needs.validate-pr-branch-name.result == 'skipped') uses: ./.github/workflows/build.yml with: pack: false - secrets: inherit \ No newline at end of file + secrets: inherit