File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 1010 env :
1111 GH_REPO : ${{ github.repository }}
1212 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
13- NEEDSREVIEWCOL : " MDEzOlByb2plY3RDb2x1bW43MTEwMTI4"
1413 PRID : ${{ github.event.pull_request.node_id }}
1514 PRBODY : ${{ github.event.pull_request.body }}
1615 PRNUM : ${{ github.event.pull_request.number }}
@@ -26,10 +25,21 @@ jobs:
2625 gh pr close $PRNUM
2726 }
2827
28+ colID () {
29+ gh api graphql -f query='query($owner:String!, $repo:String!) {
30+ repository(owner:$owner, name:$repo) {
31+ project(number:1) {
32+ columns(first:10) { nodes {id,name} }
33+ }
34+ }
35+ }' -F owner=:owner -F repo=:repo \
36+ -q ".data.repository.project.columns.nodes[] | select(.name | startswith(\"$1\")) | .id"
37+ }
38+
2939 addToBoard () {
3040 gh api graphql --silent -f query='
3141 mutation($colID:ID!, $pr:ID!) { addProjectCard(input: { projectColumnId: $colID, contentId: $prID }) { clientMutationId } }
32- ' -f colID="$NEEDSREVIEWCOL " -f prID="$PRID"
42+ ' -f colID="$(colID "Needs review") " -f prID="$PRID"
3343 }
3444
3545 if gh api orgs/cli/public_members/$PRAUTHOR --silent 2>/dev/null
You can’t perform that action at this time.
0 commit comments