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.
This commit is contained in:
parent
815ae7a22d
commit
a35d451b67
1 changed files with 9 additions and 3 deletions
12
.github/workflows/prauto.yml
vendored
12
.github/workflows/prauto.yml
vendored
|
|
@ -9,7 +9,7 @@ jobs:
|
|||
- name: lint pr
|
||||
env:
|
||||
GH_REPO: ${{ github.repository }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.AUTOMATION_TOKEN }}
|
||||
PRID: ${{ github.event.pull_request.node_id }}
|
||||
PRBODY: ${{ github.event.pull_request.body }}
|
||||
PRNUM: ${{ github.event.pull_request.number }}
|
||||
|
|
@ -44,8 +44,14 @@ jobs:
|
|||
|
||||
if gh api orgs/cli/public_members/$PRAUTHOR --silent 2>/dev/null
|
||||
then
|
||||
# TODO this errors if it's already on the board...
|
||||
addToBoard
|
||||
if ! errtext="$(addToBoard 2>&1)"
|
||||
then
|
||||
cat <<<"$errtext" >&2
|
||||
if ! grep -iq 'project already has the associated issue' <<<"$errtext"
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue