File tree 2 files changed +54
-6
lines changed
2 files changed +54
-6
lines changed Original file line number Diff line number Diff line change 1
- name : Create Internal issue when the "High Priority" label is applied
1
+ name : Create or Label Mirror Issue
2
2
on :
3
3
issues :
4
4
types :
5
5
- labeled
6
6
7
7
env :
8
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
9
TITLE_PREFIX : " [duckdb-wasm/#${{ github.event.issue.number }}]"
12
10
PUBLIC_ISSUE_TITLE : ${{ github.event.issue.title }}
13
11
14
12
jobs :
15
13
create_or_label_issue :
16
- if : github.event.label.name == 'High Priority '
14
+ if : github.event.label.name == 'reproduced' || github.event.label.name == 'under review '
17
15
runs-on : ubuntu-latest
18
16
steps :
19
17
- name : Get mirror issue number
20
18
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
19
+ gh issue list --repo duckdblabs/duckdb-internal --search "${TITLE_PREFIX}" --json title,number --state all -- jq ".[] | select(.title | startswith(\"$TITLE_PREFIX\")).number" > mirror_issue_number.txt
22
20
echo "MIRROR_ISSUE_NUMBER=$(cat mirror_issue_number.txt)" >> $GITHUB_ENV
23
21
24
22
- name : Print whether mirror issue exists
31
29
32
30
- name : Create or label issue
33
31
run : |
32
+ export LABEL="Wasm"
34
33
if [ "$MIRROR_ISSUE_NUMBER" == "" ]; then
35
- gh issue create --repo duckdblabs/duckdb-internal --label "Wasm " --title "$TITLE_PREFIX - $PUBLIC_ISSUE_TITLE" --body "See https://github.com/duckdb/duckdb-wasm /issues/${{ github.event.issue.number }}"
34
+ gh issue create --repo duckdblabs/duckdb-internal --label "$LABEL " --title "$TITLE_PREFIX - $PUBLIC_ISSUE_TITLE" --body "See https://github.com/duckdb/duckdb/issues/${{ github.event.issue.number }}"
36
35
fi
36
+
Original file line number Diff line number Diff line change
1
+ name : Update Mirror Issue
2
+ on :
3
+ issues :
4
+ types :
5
+ - closed
6
+ - reopened
7
+
8
+ env :
9
+ GH_TOKEN : ${{ secrets.DUCKDBLABS_BOT_TOKEN }}
10
+ TITLE_PREFIX : " [duckdb-wasm/#${{ github.event.issue.number }}]"
11
+
12
+ jobs :
13
+ update_mirror_issue :
14
+ runs-on : ubuntu-latest
15
+ steps :
16
+ - name : Get mirror issue number
17
+ run : |
18
+ gh issue list --repo duckdblabs/duckdb-internal --search "${TITLE_PREFIX}" --json title,number --state all --jq ".[] | select(.title | startswith(\"$TITLE_PREFIX\")).number" > mirror_issue_number.txt
19
+ echo "MIRROR_ISSUE_NUMBER=$(cat mirror_issue_number.txt)" >> $GITHUB_ENV
20
+
21
+ - name : Print whether mirror issue exists
22
+ run : |
23
+ if [ "$MIRROR_ISSUE_NUMBER" == "" ]; then
24
+ echo "Mirror issue with title prefix '$TITLE_PREFIX' does not exist yet"
25
+ else
26
+ echo "Mirror issue with title prefix '$TITLE_PREFIX' exists with number $MIRROR_ISSUE_NUMBER"
27
+ fi
28
+
29
+ - name : Add comment with status to mirror issue
30
+ run : |
31
+ if [ "$MIRROR_ISSUE_NUMBER" != "" ]; then
32
+ gh issue comment --repo duckdblabs/duckdb-internal $MIRROR_ISSUE_NUMBER --body "The issue has been ${{ github.event.action }} (https://github.com/duckdb/duckdb/issues/${{ github.event.issue.number }})."
33
+ fi
34
+
35
+ - name : Add closed label to mirror issue
36
+ if : github.event.action == 'closed'
37
+ run : |
38
+ if [ "$MIRROR_ISSUE_NUMBER" != "" ]; then
39
+ gh issue edit --repo duckdblabs/duckdb-internal $MIRROR_ISSUE_NUMBER --add-label "public closed" --remove-label "public reopened"
40
+ fi
41
+
42
+ - name : Reopen mirror issue and add reopened label
43
+ if : github.event.action == 'reopened'
44
+ run : |
45
+ if [ "$MIRROR_ISSUE_NUMBER" != "" ]; then
46
+ gh issue reopen --repo duckdblabs/duckdb-internal $MIRROR_ISSUE_NUMBER
47
+ gh issue edit --repo duckdblabs/duckdb-internal $MIRROR_ISSUE_NUMBER --add-label "public reopened" --remove-label "public closed"
48
+ fi
You can’t perform that action at this time.
0 commit comments