Skip to content

Commit 09bdb5b

Browse files
committed
CI: Add workflow file for labelling issues as 'High Priority'
1 parent daeb0f7 commit 09bdb5b

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Create Internal issue when the "High Priority" label is applied
2+
on:
3+
issues:
4+
types:
5+
- labeled
6+
7+
env:
8+
GH_TOKEN: ${{ secrets.DUCKDBLABS_BOT_TOKEN }}
9+
# an event triggering this workflow is either an issue or a pull request,
10+
# hence only one of the numbers will be filled in the TITLE_PREFIX
11+
TITLE_PREFIX: "[duckdb-rs/#${{ github.event.issue.number }}]"
12+
PUBLIC_ISSUE_TITLE: ${{ github.event.issue.title }}
13+
14+
jobs:
15+
create_or_label_issue:
16+
if: github.event.label.name == 'High Priority'
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Get mirror issue number
20+
run: |
21+
gh issue list --repo duckdblabs/duckdb-internal --search "${TITLE_PREFIX}" --json title,number --jq ".[] | select(.title | startswith(\"$TITLE_PREFIX\")).number" > mirror_issue_number.txt
22+
echo "MIRROR_ISSUE_NUMBER=$(cat mirror_issue_number.txt)" >> $GITHUB_ENV
23+
24+
- name: Print whether mirror issue exists
25+
run: |
26+
if [ "$MIRROR_ISSUE_NUMBER" == "" ]; then
27+
echo "Mirror issue with title prefix '$TITLE_PREFIX' does not exist yet"
28+
else
29+
echo "Mirror issue with title prefix '$TITLE_PREFIX' exists with number $MIRROR_ISSUE_NUMBER"
30+
fi
31+
32+
- name: Create or label issue
33+
run: |
34+
if [ "$MIRROR_ISSUE_NUMBER" == "" ]; then
35+
gh issue create --repo duckdblabs/duckdb-internal --label "Rust" --label "High Priority" --title "$TITLE_PREFIX - $PUBLIC_ISSUE_TITLE" --body "See https://github.com/duckdb/duckdb/issues/${{ github.event.issue.number }}"
36+
fi

0 commit comments

Comments
 (0)