Skip to content
Snippets Groups Projects
Unverified Commit 6c116b0e authored by John Kleinschmidt's avatar John Kleinschmidt
Browse files

chore: move Archaeologist to GHA

parent dea6a4e5
No related merge requests found
name: 'Generate Types for Archaeologist Dig'
description: 'Generate Types for Archaeologist Dig'
inputs:
sha-file:
description: 'File containing sha'
required: true
filename:
description: 'Filename to write types to'
required: true
runs:
using: "composite"
steps:
- name: Generating Types for SHA in ${{ inputs.sha-file }}
shell: bash
run: |
git checkout $(cat ${{ inputs.sha-file }})
rm -rf node_modules
yarn install --frozen-lockfile
echo "#!/usr/bin/env node\nglobal.x=1" > node_modules/typescript/bin/tsc
node node_modules/.bin/electron-docs-parser --dir=./ --outDir=./ --moduleVersion=0.0.0-development
node node_modules/.bin/electron-typescript-definitions --api=electron-api.json --outDir=artifacts
mv artifacts/electron.d.ts artifacts/<< parameters.filename >>
git checkout .
name: Archaeologist Dig
on:
check_run:
types: [created]
jobs:
dig:
runs-on: ubuntu-latest
steps:
- name: Test check run info
run: |
echo "NAME: ${{ github.event.check_run.name }}"
echo "EXT ID: ${{ github.event.check_run.external_id }}"
echo "CHECK RUN ID: ${{ github.event.check_run.id }}"
name: Archaeologist
on:
pull_request:
jobs:
start-check:
runs-on: ubuntu-latest
permissions:
checks: write # Permission to create a Check Run
contents: write # Permission to write a repository_dispatch requests
steps:
- name: Create Archaeologist Check
id: checkrun # An ID to allow the step to be referenced
env:
GH_TOKEN: ${{ github.token }} # Expose the token for GH CLI
run: |
##########################################################
# Create a Check Run and indicate that it is being queued
# Use --jq to return the ID
##########################################################
CHECKID=$(gh api -X POST -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-f name='Artifact Comparison 2.0' \
-f head_sha='${{ github.event.pull_request.head.sha }}' \
-f status='in_progress' \
-f external_id='dig:${{ github.event.pull_request.head.sha }},remote:${{ github.event.pull_request.head.repo.clone_url }},branch:${{ github.event.pull_request.base.ref }}' \
--jq '.id' \
/repos/${{ github.repository }}/check-runs)
####################################################
# Put the ID into a step variable
####################################################
echo "checkId=$CHECKID" >> $GITHUB_OUTPUT
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment