Skip to content

start-pr-checks

start-pr-checks #4620

name: PR Checks Dispatch
on:
repository_dispatch:
types: [start-pr-checks]
permissions:
issues: write
pull-requests: write
contents: write
jobs:
run-plogon:
name: Build Plugins
runs-on: ubuntu-latest
steps:
- uses: navikt/github-app-token-generator@v1
id: get-token
with:
private-key: ${{ secrets.GH_APP_PK }}
app-id: ${{ secrets.GH_APP_ID }}
- uses: LouisBrunner/[email protected]
id: register_check
with:
token: ${{ steps.get-token.outputs.token }}
name: Build PR
sha: ${{ github.event.client_payload.ref }}
status: in_progress
details_url: "https://github.com/goatcorp/DalamudPluginsD17/actions/runs/${{ github.run_id }}"
- name: Checkout manifests
uses: actions/checkout@v3
with:
repository: goatcorp/DalamudPluginsD17
path: manifests
ref: ${{ github.event.client_payload.ref }}
- name: Checkout Plogon
uses: actions/checkout@v3
with:
repository: goatcorp/Plogon
#ref: V1.0.6
path: Plogon
- name: Checkout Dist
uses: actions/checkout@v3
with:
repository: goatcorp/PluginDistD17
path: output
ref: main
- name: Create required folders
run: |
mkdir artifacts
mkdir static
mkdir work
- name: Cache docker image
uses: actions/cache@v3
env:
cache-name: ${{ secrets.EXTENDED_IMAGE_LINK }}
with:
path: ~/.plogon_cache
key: cache-${{ env.cache-name }}
- name: Run Plogon
id: plogon_run
working-directory: Plogon/Plogon
env:
GITHUB_TOKEN: ${{ secrets.GH_BOT_PAT }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
XLWEB_KEY: ${{ secrets.XLWEB_KEY }}
EXTENDED_IMAGE_LINK: ${{ secrets.EXTENDED_IMAGE_LINK }}
PLOGON_SECRETS_PK: ${{ secrets.PLOGON_SECRETS_PK }}
PLOGON_SECRETS_PK_PASSWORD: ${{ secrets.PLOGON_SECRETS_PK_PASSWORD }}
GITHUB_REPOSITORY: ${{ github.repository }}
PR_ACTOR: ${{ github.event.client_payload.actor }}
GITHUB_PR_NUM: ${{ github.event.client_payload.prnum }}
GITHUB_RUN_ID: ${{ github.run_id }}
run: |
dotnet run -- \
--manifest-folder="${{ github.workspace }}/manifests" \
--output-folder="${{ github.workspace }}/output" \
--work-folder="${{ github.workspace }}/work" \
--static-folder="${{ github.workspace }}/Plogon/Plogon/static" \
--artifact-folder="${{ github.workspace }}/artifacts" \
--ci --mode=PullRequest
cat $GITHUB_STEP_SUMMARY
echo ::set-output name=summary::$(cat $GITHUB_STEP_SUMMARY)
echo ::set-output name=summary_json::$(awk '{printf "%s\\n", $0}' $GITHUB_STEP_SUMMARY)
echo ${{ steps.plogon_run.outputs.summary }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: plugin-artifact
path: artifacts
- uses: LouisBrunner/[email protected]
if: always()
with:
token: ${{ steps.get-token.outputs.token }}
check_id: ${{ steps.register_check.outputs.check_id }}
conclusion: ${{ job.status }}
details_url: "https://github.com/goatcorp/DalamudPluginsD17/actions/runs/${{ github.run_id }}"
output: |
{"summary":"${{ steps.plogon_run.outputs.summary_json }}"}