Skip to content

Commit

Permalink
feat: update check
Browse files Browse the repository at this point in the history
  • Loading branch information
bojanrajh committed Oct 27, 2023
1 parent 80e7230 commit 93442c3
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/scripts/update-check.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const { Octokit } = require('@octokit/rest');

const octokit = new Octokit({
auth: process.env.PERSONAL_ACCESS_TOKEN,
});

async function createCheck() {
const response = await octokit.checks.update({
owner: process.env.DEV_HUB_REPO.split('/')[0],
repo: process.env.DEV_HUB_REPO.split('/')[1],
check_run_id: process.env.DEV_HUB_CHECK,
name: 'DevHub',
status: 'completed',
conclusion: 'success',
completed_at: new Date().toISOString(),
output: {
title: 'Developer Portal healthcheck',
summary: 'Building the project in DevHub (Developer Portal)',
},
});

console.log('Check updated:', response.data);
}

createCheck();
29 changes: 29 additions & 0 deletions .github/workflows/external-healthcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,37 @@ on:
description: "Commit to checkout"
required: true
type: string
check:
description: "Check ID"
required: true
type: string

jobs:

update-check-run:
name: Test build
runs-on: ubuntu-latest
#needs:
# - trigger-build
steps:

- name: Install dependencies
run: |
npm i @octokit/rest
- name: Checkout Repository
uses: actions/checkout@v2

- name: Update Check
run: |
node .github/scripts/update-check.js
exit 1
env:
PERSONAL_ACCESS_TOKEN: ${{ secrets.DEV_HUB_PERSONAL_ACCESS_TOKEN }}
DEV_HUB_BRANCH: ${{ inputs.branch }}
DEV_HUB_REPO: ${{ inputs.repo }}
DEV_HUB_CHECK: ${{ inputs.check }}

trigger-build:
runs-on: ubuntu-latest

Expand Down

0 comments on commit 93442c3

Please sign in to comment.