Skip to content

Commit

Permalink
feat: extract workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bojanrajh committed Nov 7, 2023
1 parent 15221ee commit c70a565
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/healthcheck.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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/[email protected]
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 }}

0 comments on commit c70a565

Please sign in to comment.