Files
gentoo-zh/.github/workflows/pkgcheck-comment.yml
T
Zakk 5cefccb26c .github/workflows: move trial and pkgcheck comment logic into scripts
Because the engine returns to master, restore the dispatched ref so
every trial target uses the selected scripts. Reuse the worker image
because it already supplies the trial setup and tools.

A skipped report job leaves no artifact, so skip its download and comment
instead of failing the comment workflow. Select a marker across all
comment pages because per-page lookup can return several comment IDs.

Signed-off-by: Zakk <zakk@gentoozh.org>
2026-10-02 01:54:16 +10:00

48 lines
1.4 KiB
YAML

name: pkgcheck-comment
on:
workflow_run:
workflows: [pkgcheck]
types: [completed]
permissions:
contents: read
pull-requests: write
actions: read
jobs:
comment:
if: github.event.workflow_run.event == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v7
- name: Check for the report
id: report
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
RUN_ID: ${{ github.event.workflow_run.id }}
run: |
artifacts=$(gh api "repos/$REPO/actions/runs/$RUN_ID/artifacts" --paginate --slurp)
available=$(jq 'any(.[] | .artifacts[]; .name == "pkgcheck-report")' <<< "$artifacts")
echo "available=$available" >> "$GITHUB_OUTPUT"
- name: Download the report
if: steps.report.outputs.available == 'true'
uses: actions/download-artifact@v8
with:
name: pkgcheck-report
path: pkgcheck-report
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Post the report
if: steps.report.outputs.available == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
RUN_URL: ${{ github.event.workflow_run.html_url }}
run: scripts/pkgcheck-comment.sh pkgcheck-report