X Tutup
Skip to content

Commit a35d451

Browse files
committed
Fix PR automation workflow
- Use AUTOMATION_TOKEN to get around "resource not available by integration". It looks like jobs triggered from community pull requests do not have permissions to write to our project. - Tolerate the "project already has the associated issue" error for staff as non-fatal.
1 parent 815ae7a commit a35d451

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/prauto.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
- name: lint pr
1010
env:
1111
GH_REPO: ${{ github.repository }}
12-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
GH_TOKEN: ${{ secrets.AUTOMATION_TOKEN }}
1313
PRID: ${{ github.event.pull_request.node_id }}
1414
PRBODY: ${{ github.event.pull_request.body }}
1515
PRNUM: ${{ github.event.pull_request.number }}
@@ -44,8 +44,14 @@ jobs:
4444
4545
if gh api orgs/cli/public_members/$PRAUTHOR --silent 2>/dev/null
4646
then
47-
# TODO this errors if it's already on the board...
48-
addToBoard
47+
if ! errtext="$(addToBoard 2>&1)"
48+
then
49+
cat <<<"$errtext" >&2
50+
if ! grep -iq 'project already has the associated issue' <<<"$errtext"
51+
then
52+
exit 1
53+
fi
54+
fi
4955
exit 0
5056
fi
5157

0 commit comments

Comments
 (0)
X Tutup