diff --git a/.github/workflows/needs-boundary.yml b/.github/workflows/needs-boundary.yml index 68c2577d83..b9bf8cd254 100644 --- a/.github/workflows/needs-boundary.yml +++ b/.github/workflows/needs-boundary.yml @@ -25,13 +25,12 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} N: ${{ github.event.issue.number }} - BODY: ${{ github.event.issue.body }} - REFUSED: ${{ contains(github.event.issue.labels.*.name, 'shape-refused') }} - STATE: ${{ github.event.issue.state }} run: | printf '#include "gen/c/policy/issue_shape.c"\n#include \nint main(void){static char b[1<<20],o[1<<16];unsigned r=check_issue((uint8_t*)b,fread(b,1,sizeof b,stdin),(uint8_t*)o,sizeof o);fputs(o,stdout);return r?1:0;}\n' > shape.c cc -O1 -w -o shape shape.c - if printenv BODY | ./shape > why.txt; then + gh issue view "$N" -R "$GITHUB_REPOSITORY" --json body,state,labels > now.json # the issue as it is now, not the payload: a run queued 38 min closed #10897 after an edit had fixed it (#11007) + STATE=$(jq -r '.state | ascii_downcase' now.json); REFUSED=$(jq -r 'any(.labels[]; .name == "shape-refused")' now.json) + if jq -j '.body // ""' now.json | ./shape > why.txt; then if [ "$REFUSED" = true ]; then gh issue edit "$N" --remove-label shape-refused && gh issue reopen "$N" -c "The shape check passes now (specs/policy/issue_shape.t27); reopened."; fi elif [ "$STATE" = open ]; then { echo "Closed by the issue-shape gate (specs/policy/issue_shape.t27, #7498): an issue must have the template's sections. Edit the body; an edit that passes reopens it."; echo; sed 's/^/- /' why.txt; } > msg.md