]> Piment Noir Git Repositories - poolifier.git/commitdiff
ci: dispatch release PR checks
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 22 Aug 2026 14:33:17 +0000 (16:33 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 22 Aug 2026 14:33:17 +0000 (16:33 +0200)
.github/workflows/ci.yml
.github/workflows/release-please.yml

index e014bd24375c94fc3dc0a7c33fc20fddd694161b..bc9a827a53230d36886db57b694962b294e0cb75 100644 (file)
@@ -7,6 +7,20 @@ on:
     types: [opened, synchronize, reopened]
   merge_group:
     branches: [master]
+  workflow_dispatch:
+    inputs:
+      pull_request:
+        description: Pull request number
+        required: true
+        type: string
+      head_ref:
+        description: Pull request head branch
+        required: true
+        type: string
+      base_ref:
+        description: Pull request base branch
+        required: true
+        type: string
 
 permissions:
   contents: read
@@ -69,6 +83,9 @@ jobs:
       - name: SonarCloud Code Analysis
         if: ${{ steps.sonar-token.outputs.available == 'true' && github.repository == 'poolifier/poolifier' && matrix.os == 'ubuntu-latest' && matrix.node == '22.x' }}
         uses: sonarsource/sonarqube-scan-action@v8.2
+        with:
+          args: >-
+            ${{ github.event_name == 'workflow_dispatch' && format('-Dsonar.pullrequest.key={0} -Dsonar.pullrequest.branch={1} -Dsonar.pullrequest.base={2}', inputs.pull_request, inputs.head_ref, inputs.base_ref) || '' }}
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
index 61eae100737ce6f8bd914fe799212a0edac07f5e..40e9de71cac5c2a7e9c92658a73cf8c23844052b 100644 (file)
@@ -14,6 +14,7 @@ jobs:
     if: github.repository == 'poolifier/poolifier'
 
     permissions:
+      actions: write
       contents: write
       issues: write
       pull-requests: write
@@ -28,6 +29,20 @@ jobs:
           config-file: .github/release-please/config.json
           manifest-file: .github/release-please/manifest.json
 
+      - name: Dispatch CI for release pull request
+        if: ${{ steps.release.outputs.prs_created == 'true' }}
+        env:
+          GH_TOKEN: ${{ github.token }}
+          RELEASE_PR: ${{ steps.release.outputs.pr }}
+        run: |
+          head_ref=$(jq -r '.headBranchName' <<< "$RELEASE_PR")
+          gh workflow run ci.yml \
+            --repo "${{ github.repository }}" \
+            --ref "$head_ref" \
+            --field pull_request="$(jq -r '.number' <<< "$RELEASE_PR")" \
+            --field head_ref="$head_ref" \
+            --field base_ref="$(jq -r '.baseBranchName' <<< "$RELEASE_PR")"
+
   build-release:
     needs: release-please
     runs-on: ubuntu-latest