File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 1313 compile :
1414 name : Compiles
1515 runs-on : ubuntu-latest
16+ defaults :
17+ run :
18+ shell : bash -e {0} 2> >(tee -a stderr.log >&2)
1619 steps :
1720 - uses : actions/checkout@v4
1821 with :
5053
5154 - name : Tests
5255 run : npm run test
56+
57+ - name : post build errors as PR comment
58+ if : failure()
59+ run : |
60+ # gh run view ${{ github.run_id }} --repo ${{ github.repository }} --log-failed > logs.txt
61+ # ERRORS=$(cat logs.txt |
62+ # cut -d$'\t' -f3 | # remove workflow/step columns
63+ # cut -d' ' -f2-) # remove timestamp
64+ # sed -n '/\[.*error.*\]/I,$p') # select lines from '[...error...]' or 'npm err' (case-insensitive) to EOF
65+
66+ if [ -s "stderr.log" ]; then
67+ echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
68+
69+ URL=$(gh run view ${{ github.run_id }} --json url --jq '.url')
70+ BODY="[Build failed]($URL)\n\n\`\`\`txt\n$(cat stderr.log)\n\`\`\`"
71+
72+ gh pr comment ${{ github.event.number }} --repo ${{ github.repository }} --body $BODY
73+ fi
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ export default defineConfig({
174174 "./src/title.css" ,
175175 "./src/tooltips.css" ,
176176 ] ,
177- pagination : false ,
177+ pagination : "test" ,
178178 plugins : [
179179 ...( runLinkCheck
180180 ? [
You can’t perform that action at this time.
0 commit comments