From 322c6a36ee92dd8ab375cc9eda5fb267db131c5b Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Wed, 1 Jul 2020 19:50:24 +0800 Subject: [PATCH] Fix .github config --- .github/ISSUE_TEMPLATE.md | 5 -- .github/PULL_REQUEST_TEMPLATE.md | 11 --- .github/labeler.yml | 6 -- .github/labels.json | 139 ++++++++++++++++++++++++++++++ .github/workflows/issue.yml | 15 ---- .github/workflows/issue_stale.yml | 19 ---- .github/workflows/labeler.yml | 19 ++++ .github/workflows/stale.yml | 21 +++++ 8 files changed, 179 insertions(+), 56 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE.md delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/labeler.yml create mode 100644 .github/labels.json delete mode 100644 .github/workflows/issue.yml delete mode 100644 .github/workflows/issue_stale.yml create mode 100644 .github/workflows/labeler.yml create mode 100644 .github/workflows/stale.yml diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index ac311633..00000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,5 +0,0 @@ -Your issue may already be reported! Please search on the [issue track](https://github.com/go-gorm/gorm/issues) before creating one. - -To report a bug, your issue *have to* include an [GORM playground pull request link](https://github.com/go-gorm/playground), for general questions, please delete below line. - -## GORM Playground Link: https://github.com/go-gorm/playground/pull/1 (change this to your link) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 930ff176..00000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,11 +0,0 @@ -Make sure these boxes checked before submitting your pull request. - -- [] Do only one thing -- [] No API-breaking changes -- [] New code/logic commented & tested (important) - -For significant changes like big bug fixes, new features, please open an issue to make an agreement on an implementation design/plan first before starting it. - -### What did this pull request do? - -### Use Case diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index d96bafa0..00000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,6 +0,0 @@ -# Add/remove 'critical' label if issue contains the words 'urgent' or 'critical' -HasGormPlaygroundTestCase: - - '(github.com/go-gorm/playground/pull/\d)' - -NoTestCase: - - '(change this to your link)' diff --git a/.github/labels.json b/.github/labels.json new file mode 100644 index 00000000..8b1ce849 --- /dev/null +++ b/.github/labels.json @@ -0,0 +1,139 @@ +{ + "labels": { + "critical": { + "name": "type:critical", + "colour": "#E84137", + "description": "critical questions" + }, + "question": { + "name": "type:question", + "colour": "#EDEDED", + "description": "general questions" + }, + "with_playground": { + "name": "type:with reproduction steps", + "colour": "#00ff00", + "description": "with reproduction steps" + }, + "without_playground": { + "name": "type:missing reproduction steps", + "colour": "#CF2E1F", + "description": "missing reproduction steps" + }, + "has_pr": { + "name": "type:has pull request", + "colour": "#43952A", + "description": "has pull request" + }, + "not_tested": { + "name": "type:not tested", + "colour": "#CF2E1F", + "description": "not tested" + }, + "tested": { + "name": "type:tested", + "colour": "#00ff00", + "description": "tested" + }, + "breaking_change": { + "name": "type:breaking change", + "colour": "#CF2E1F", + "description": "breaking change" + } + }, + "issue": { + "with_playground": { + "requires": 1, + "conditions": [ + { + "type": "descriptionMatches", + "pattern": "/github.com\/go-gorm\/playground\/pull\/\\d\\d+/s" + } + ] + }, + "critical": { + "requires": 1, + "conditions": [ + { + "type": "descriptionMatches", + "pattern": "/(critical|urgent)/i" + }, + { + "type": "titleMatches", + "pattern": "/(critical|urgent)/i" + } + ] + }, + "question": { + "requires": 1, + "conditions": [ + { + "type": "titleMatches", + "pattern": "/question/i" + }, + { + "type": "descriptionMatches", + "pattern": "/question/i" + } + ] + }, + "without_playground": { + "requires": 5, + "conditions": [ + { + "type": "descriptionMatches", + "pattern": "/^((?!github.com\/go-gorm\/playground\/pull\/\\d\\d+).)*$/s" + }, + { + "type": "titleMatches", + "pattern": "/^((?!question).)*$/s" + }, + { + "type": "descriptionMatches", + "pattern": "/^((?!question).)*$/is" + }, + { + "type": "titleMatches", + "pattern": "/^((?!critical|urgent).)*$/s" + }, + { + "type": "descriptionMatches", + "pattern": "/^((?!critical|urgent).)*$/s" + } + ] + } + }, + "pr": { + "critical": { + "requires": 1, + "conditions": [ + { + "type": "descriptionMatches", + "pattern": "/(critical|urgent)/i" + }, + { + "type": "titleMatches", + "pattern": "/(critical|urgent)/i" + } + ] + }, + "not_tested": { + "requires": 1, + "conditions": [ + { + "type": "descriptionMatches", + "pattern": "/\\[\\] Tested/" + } + ] + }, + "breaking_change": { + "requires": 1, + "conditions": [ + { + "type": "descriptionMatches", + "pattern": "/\\[\\] Non breaking API changes/" + } + ] + } + } +} diff --git a/.github/workflows/issue.yml b/.github/workflows/issue.yml deleted file mode 100644 index 0759782c..00000000 --- a/.github/workflows/issue.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: "Issue-Labeler" -on: - issues: - types: [opened, edited] - -jobs: - triage: - runs-on: ubuntu-latest - steps: - - uses: github/issue-labeler@v2.0 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - configuration-path: ".github/labeler.yml" - not-before: "2020-01-15T02:54:32Z" - enable-versioned-regex: 0 \ No newline at end of file diff --git a/.github/workflows/issue_stale.yml b/.github/workflows/issue_stale.yml deleted file mode 100644 index fadfb522..00000000 --- a/.github/workflows/issue_stale.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Issue cleanup -on: - schedule: - - cron: '0 1 * * *' # At 01:00, everyday -jobs: - triage_issues: - name: Issue triage - runs-on: ubuntu-latest - steps: - - name: Find old issues and mark them stale - uses: Krizzu/issue-triage-action@v1.0.0 - with: - ghToken: ${{ secrets.GITHUB_TOKEN }} - staleAfter: 7 - closeAfter: 14 - staleLabel: "STALE 📺" - staleComment: "This issue is %DAYS_OLD% days old, marking as stale! cc: @%AUTHOR%" - closeComment: "Issue last updated %DAYS_OLD% days ago! Closing down!" - showLogs: true \ No newline at end of file diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 00000000..1490730b --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,19 @@ +name: "Issue Labeler" +on: + issues: + types: [opened, edited, reopened] + pull_request: + types: [opened, edited, reopened, ready_for_review, synchronize] + +jobs: + triage: + runs-on: ubuntu-latest + name: Label issues and pull requests + steps: + - name: check out + uses: actions/checkout@v2 + + - name: labeler + uses: jinzhu/super-labeler-action@develop + with: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 00000000..6fb714ca --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,21 @@ +name: "Close Missing Playground issues" +on: + schedule: + - cron: "*/10 * * * *" + +jobs: + stale: + runs-on: ubuntu-latest + env: + ACTIONS_STEP_DEBUG: true + steps: + - name: Close Stale Issues + uses: actions/stale@v3.0.7 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: "This issue has been automatically marked as stale as it missing playground pull request link, checkout [https://github.com/go-gorm/playground](https://github.com/go-gorm/playground) for details, it will be closed in 2 days if no further activity occurs." + stale-issue-label: "status:stale" + days-before-stale: 0 + days-before-close: 2 + remove-stale-when-updated: true + only-labels: "type:missing reproduction steps"