Files
OrcaSlicer/.github/workflows/check_gcode_label.yml
T
Hanif Koh 49252d14b7 Post the Sliced G-code Comparison on Pull Requests With the check-gcode Label
check_gcode_comment.yml runs when a pull request's Build all run or a
check-gcode label run completes, finds the open pull requests from that
branch, and posts the report of the newest finished build on each one
that has the label. check_gcode_label.yml only wakes it when the label
is added after the build finished; it needs no token and runs nothing.
Neither uses pull_request_target, which GitHub blocks by default in
public repositories.

Runs are kept only when their head repository and branch are the pull
request's, and the artifact must name the pull request, so another fork
at the same commit cannot have its report posted. A run waiting for
approval counts as not finished. The comment is kept when unchanged,
edited in place when only the commit or the baseline moved, and
replaced otherwise. The report appears only inside a fence nothing in
it can close, errors print their type and HTTP status only, and the
step cannot leave a red check.
2026-11-28 22:08:48 +08:00

26 lines
883 B
YAML

name: check-gcode label
# Wakes check_gcode_comment.yml when the check-gcode label is added after the pull request's
# build finished. It runs no pull request code and needs no token. A pull_request run cannot post
# on a pull request from a fork, and pull_request_target is blocked by default in public
# repositories, so the comment is posted by a workflow_run workflow instead.
#
# The workflow name is matched in check_gcode_comment.yml. No branches filter: a pull request
# into another branch is told why it gets no report.
on:
pull_request:
types:
- labeled
permissions: {}
jobs:
wake:
name: Wake the comparison comment
if: ${{ github.event.label.name == 'check-gcode' }}
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Note the label
run: echo "check_gcode_comment.yml posts the comparison when this run completes."