Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -53,6 +67,9 @@ jobs:
- name: SonarCloud Code Analysis
if: ${{ steps.sonar-token.outputs.available == 'true' && github.repository == 'poolifier/poolifier-web-worker' }}
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 }}
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ jobs:
if: github.repository == 'poolifier/poolifier-web-worker'

permissions:
actions: write
contents: write
issues: write
pull-requests: write

outputs:
Expand All @@ -27,6 +29,23 @@ 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: |
pull_request=$(jq -r '.number' <<< "$RELEASE_PR")
head_ref=$(jq -r '.headBranchName' <<< "$RELEASE_PR")
base_ref=$(jq -r '.baseBranchName' <<< "$RELEASE_PR")

gh workflow run ci.yml \
--repo "${{ github.repository }}" \
--ref "$head_ref" \
--raw-field pull_request="$pull_request" \
--raw-field head_ref="$head_ref" \
--raw-field base_ref="$base_ref"

build-release:
needs: release-please
runs-on: ubuntu-latest
Expand Down
Loading