Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/needs-boundary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdio.h>\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
Expand Down
Loading