File: InternalIssuesUpdateMirror.yml

package info (click to toggle)
duckdb 1.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 299,196 kB
  • sloc: cpp: 865,414; ansic: 57,292; python: 18,871; sql: 12,663; lisp: 11,751; yacc: 7,412; lex: 1,682; sh: 747; makefile: 558
file content (51 lines) | stat: -rw-r--r-- 2,129 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Update Mirror Issue
on:
  discussion:
    types:
      - labeled
  issues:
    types:
      - closed
      - reopened

env:
  GH_TOKEN: ${{ secrets.DUCKDBLABS_BOT_TOKEN }}
  TITLE_PREFIX: "[duckdb/#${{ github.event.issue.number || github.event.discussion.number }}]"

jobs:
  update_mirror_issue:
    runs-on: ubuntu-latest
    steps:
      - name: Get mirror issue number
        run: |
          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
          echo "MIRROR_ISSUE_NUMBER=$(cat mirror_issue_number.txt)" >> $GITHUB_ENV

      - name: Print whether mirror issue exists
        run: |
          if [ "$MIRROR_ISSUE_NUMBER" == "" ]; then
            echo "Mirror issue with title prefix '$TITLE_PREFIX' does not exist yet"
          else
            echo "Mirror issue with title prefix '$TITLE_PREFIX' exists with number $MIRROR_ISSUE_NUMBER"
          fi

      - name: Add comment with status to mirror issue
        run: |
          if [ "$MIRROR_ISSUE_NUMBER" != "" ]; then
            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 || github.event.discussion.number }})."
          fi

      - name: Add closed label to mirror issue
        if: github.event.action == 'closed'
        run: |
          if [ "$MIRROR_ISSUE_NUMBER" != "" ]; then
            gh issue edit --repo duckdblabs/duckdb-internal $MIRROR_ISSUE_NUMBER --add-label "public closed" --remove-label "public reopened"
          fi

      - name: Reopen mirror issue and add reopened label
        if: github.event.action == 'reopened'
        run: |
          if [ "$MIRROR_ISSUE_NUMBER" != "" ]; then
            gh issue reopen --repo duckdblabs/duckdb-internal $MIRROR_ISSUE_NUMBER
            gh issue edit --repo duckdblabs/duckdb-internal $MIRROR_ISSUE_NUMBER --add-label "public reopened" --remove-label "public closed"
          fi