Thanks to visit codestin.com
Credit goes to github.com

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
16 changes: 0 additions & 16 deletions .github/workflows/prauto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.AUTOMATION_TOKEN }}
PRID: ${{ github.event.pull_request.node_id }}
PRBODY: ${{ github.event.pull_request.body }}
PRNUM: ${{ github.event.pull_request.number }}
PRHEAD: ${{ github.event.pull_request.head.label }}
Expand All @@ -43,26 +42,12 @@ jobs:
-q ".data.repository.project.columns.nodes[] | select(.name | startswith(\"$1\")) | .id"
}

addToBoard () {
gh api graphql --silent -f query='
mutation($colID:ID!, $prID:ID!) { addProjectCard(input: { projectColumnId: $colID, contentId: $prID }) { clientMutationId } }
' -f colID="$(colID "Needs review")" -f prID="$PRID"
}

if [ "$PR_AUTHOR_TYPE" = "Bot" ] || gh api orgs/cli/public_members/$PRAUTHOR --silent 2>/dev/null
then
if [ "$PR_AUTHOR_TYPE" != "Bot" ]
then
gh pr edit $PRNUM --add-assignee $PRAUTHOR
fi
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

Expand All @@ -86,5 +71,4 @@ jobs:
commentPR "Hi! Thanks for the pull request. Please ensure that this change is linked to an issue by mentioning an issue number in the description of the pull request. If this pull request would close the issue, please put the word 'Fixes' before the issue number somewhere in the pull request body. If this is a tiny change like fixing a typo, feel free to ignore this message."
fi

addToBoard
exit 0
Loading