Skip to content

Commit

Permalink
feat: cleanup workflows and scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
bojanrajh committed Nov 7, 2023
1 parent 3cd939b commit ecb16b4
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 48 deletions.
29 changes: 0 additions & 29 deletions .github/scripts/trigger-workflow.cjs

This file was deleted.

32 changes: 13 additions & 19 deletions .github/workflows/external-healthcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,25 +125,19 @@ jobs:
- trigger-build
if: ${{ always() }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Prepare
uses: ./.github/actions/checkout-install
- uses: octokit/[email protected]
name: Update check
with:
apt: true

- name: Install dependencies
run: |
pnpm i @octokit/rest
- name: Update Check
run: |
node .github/scripts/trigger-workflow.cjs
route: POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches
owner: ${{ inputs.owner }}
repo: ${{ inputs.repo }}
ref: main
workflow_id: update-healthcheck.yml
inputs: |
owner: ${{ inputs.owner }}
repo: ${{ inputs.repo }}
check: "${{ fromJson(steps.create_check_run.outputs.data).id }}"
conclusion: ${{ steps.status.outputs.success == 'true' && 'success' || 'failure' }}
env:
PERSONAL_ACCESS_TOKEN: ${{ secrets.DEV_HUB_PERSONAL_ACCESS_TOKEN }}
DEV_HUB_BRANCH: ${{ inputs.branch }}
DEV_HUB_REPO: ${{ inputs.repo }}
DEV_HUB_SHA: ${{ inputs.sha }}
DEV_HUB_CHECK: ${{ inputs.check }}
DEV_HUB_CONCLUSION: ${{ steps.status.outputs.success == 'true' && 'success' || 'failure' }}
GITHUB_TOKEN: ${{ secrets.DEV_HUB_PERSONAL_ACCESS_TOKEN }}
45 changes: 45 additions & 0 deletions .github/workflows/update-healthcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# this action is used by sub-repos
on:
workflow_call:
inputs:
owner:
description: "Owner to checkout"
required: true
type: string
repo:
description: "Repo to checkout"
required: true
type: string
check:
description: "Check ID"
required: true
type: string
conclusion:
description: "Healthcheck conclusion"
required: true
type: string
secrets:
TOKEN:
required: true

jobs:

trigger-healthckeck:
runs-on: ubuntu-latest
steps:

- uses: octokit/[email protected]
name: Update check run
with:
route: PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}
owner: ${{ inputs.owner }}
repo: ${{ inputs.repo }}
check_run_id: ${{ inputs.check }}
name: DevHub
status: completed
conclusion: ${{ inputs.conclusion }}
output: |
title: Developer Portal healthcheck
summary: Building the project in DevHub (Developer Portal)
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}

0 comments on commit ecb16b4

Please sign in to comment.