From 205ee6df775255b008d52003a60c503019b45f0c Mon Sep 17 00:00:00 2001 From: Merel Theisen <49397448+merelcht@users.noreply.github.com> Date: Tue, 5 Nov 2024 12:44:26 +0000 Subject: [PATCH 1/2] build: Add GH action to label community issues automatically (#922) Add GH action to label community issues automatically Signed-off-by: Merel Theisen --- .github/workflows/label-community-issues.yml | 48 ++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/label-community-issues.yml diff --git a/.github/workflows/label-community-issues.yml b/.github/workflows/label-community-issues.yml new file mode 100644 index 000000000..e1c1ce118 --- /dev/null +++ b/.github/workflows/label-community-issues.yml @@ -0,0 +1,48 @@ +name: Label Community Issues + +on: + issues: + types: + - opened + +jobs: + label: + runs-on: ubuntu-latest + steps: + - name: Check if issue author is a member of Kedro org + uses: actions/github-script@v6 + id: membership + with: + github-token: ${{ secrets.GH_TAGGING_TOKEN }} + result-encoding: string + script: | + + try { + const result = await github.rest.orgs.getMembershipForUser({ + org: "kedro-org", + username: '${{ github.actor }}' + }) + + console.log(result?.data?.state) + if (result?.data?.state == "active"){ + console.log("%s: detected as an active member of Kedro org", '${{ github.actor }}') + return "member"; + } else { + console.log("%s: not detected as active member of Kedro org", '${{ github.actor }}') + return "notMember"; + } + + } catch (error) { + console.log("%s: Error occured and marked user as notMember", '${{ github.actor }}') + console.log("Error", error.stack); + console.log("Error", error.name); + console.log("Error", error.message); + return "notMember"; + } + + - name: Label issue if author is from community + if: ${{ steps.membership.outputs.result == 'notMember' }} + uses: actions-ecosystem/action-add-labels@v1 + with: + github_token: ${{ secrets.GH_TAGGING_TOKEN }} + labels: 'Community' From d4fd7dadc30efad84b26e20b69001ceff4cea9ec Mon Sep 17 00:00:00 2001 From: Merel Theisen <49397448+merelcht@users.noreply.github.com> Date: Fri, 8 Nov 2024 11:32:16 +0100 Subject: [PATCH 2/2] build: Add wizard GH action to remove label or close info needed issues (#927) * Add wizard gh action to remove label or close info needed issues Signed-off-by: Merel Theisen --- .github/workflows/no-response.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/no-response.yml diff --git a/.github/workflows/no-response.yml b/.github/workflows/no-response.yml new file mode 100644 index 000000000..b11c9be73 --- /dev/null +++ b/.github/workflows/no-response.yml @@ -0,0 +1,20 @@ +name: No Response + +on: + issue_comment: + types: [created] + schedule: + # Run every day at 9am (UTC time) + - cron: '0 9 * * *' + +jobs: + noResponse: + runs-on: ubuntu-latest + steps: + - uses: lee-dohm/no-response@v0.5.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + responseRequiredLabel: "support: needs more info" + daysUntilClose: 28 + closeComment: >- + This issue has been closed due to lack of information. Feel free to re-open this issue if you're facing a similar problem. Please provide as much information as possible so we can help resolve your issue.