diff --git a/.github/workflows/healthcheck.yml b/.github/workflows/healthcheck.yml new file mode 100644 index 00000000..7c491395 --- /dev/null +++ b/.github/workflows/healthcheck.yml @@ -0,0 +1,64 @@ +# this action is used by sub-repos +on: + workflow_call: + inputs: + owner: + required: true + type: string + sha: + required: true + type: string + branch: + required: true + type: string + repo: + required: true + type: string + secrets: + GITHUB_TOKEN: + required: true + PERSONAL_TOKEN: + required: true + +jobs: + + trigger-healthckeck: + runs-on: ubuntu-latest + steps: + + - uses: octokit/request-action@v2.x + name: Create check run + id: create_check_run + with: + route: POST /repos/{owner}/{repo}/check-runs + owner: ${{ inputs.owner }} + repo: ${{ inputs.repo }} + name: DevHub + head_sha: ${{ inputs.sha }} + output: | + title: Developer Portal healthcheck + summary: Building the project in DevHub (Developer Portal) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Validate check run + if: ${{ !fromJson(steps.create_check_run.outputs.data).id }} + run: exit 1 + + - uses: octokit/request-action@v2.x + name: Trigger workflow + id: trigger_workflow + if: ${{ fromJson(steps.create_check_run.outputs.data).id }} + with: + route: POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches + owner: shopware + repo: developer-portal + ref: main + workflow_id: external-healthcheck.yml + inputs: | + branch: ${{ inputs.branch }} + repo: ${{ inputs.repo }} + sha: ${{ inputs.sha }} + check: "${{ fromJson(steps.create_check_run.outputs.data).id }}" + env: + GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }} \ No newline at end of file