From daef17d64795233bcb01b680048d896e6ead3012 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Thu, 29 Jun 2023 13:22:43 +0800 Subject: [PATCH 1/5] chore: update the issue template --- .github/ISSUE_TEMPLATE/bug-report.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yaml b/.github/ISSUE_TEMPLATE/bug-report.yaml index 0289c27..89b75ae 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yaml +++ b/.github/ISSUE_TEMPLATE/bug-report.yaml @@ -64,6 +64,22 @@ body: - BSD validations: required: true + - type: input + id: os-version + attributes: + label: OS version + description: What's the specific version of OS? + placeholder: "Run `uname -srm` command to get the info, for example: Darwin 21.5.0 arm64, Linux 5.4.0-137-generic x86_64" + validations: + required: true + - type: input + id: go-version + attributes: + label: Go version + description: What's the specific version of Go? + placeholder: "Run `go version` command to get the info, for example: go1.20.5 linux/amd64" + validations: + required: true - type: textarea id: logs attributes: From 2c599b83a1e81ce8884ee9d4263f5ba7da8aeb3b Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Thu, 29 Jun 2023 15:16:32 +0800 Subject: [PATCH 2/5] chore: ignore some cases for GitHub actions of testing --- .github/workflows/test.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d1bee27..a01708c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,12 +7,22 @@ on: - dev paths-ignore: - '**.md' + - '.github/FUNDING.yml' + - '.github/release-drafter.yml' + - '.github/ISSUE_TEMPLATE/*' + - '.github/workflows/release-drafter.yaml' + - 'examples/*' pull_request: branches: - master - dev paths-ignore: - '**.md' + - '.github/FUNDING.yml' + - '.github/release-drafter.yml' + - '.github/ISSUE_TEMPLATE/*' + - '.github/workflows/release-drafter.yaml' + - 'examples/*' env: GO111MODULE: on From 46f9b680285ebe6e76e68a1322063417bd9ef4b9 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Fri, 30 Jun 2023 20:30:36 +0800 Subject: [PATCH 3/5] chore: update the workflow of pull requests --- .github/workflows/pull-request.yml | 17 +++++++++++++++++ .github/workflows/test.yml | 2 ++ CONTRIBUTING.md | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..d5cf385 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,17 @@ +name: Check pull request target +on: + pull_request_target: + types: + - opened + - reopened + - synchronize +jobs: + check-branches: + runs-on: ubuntu-latest + steps: + - name: Check target branch + run: | + if [ ${{ github.base_ref }} == "master" ] && [ ${{ github.head_ref }} != "dev" ]; then + echo "Only pull requests from dev branch are only allowed to be merged into master branch." + exit 1 + fi \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a01708c..0b4da1d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,6 +10,7 @@ on: - '.github/FUNDING.yml' - '.github/release-drafter.yml' - '.github/ISSUE_TEMPLATE/*' + - '.github/workflows/pull-request.yaml' - '.github/workflows/release-drafter.yaml' - 'examples/*' pull_request: @@ -21,6 +22,7 @@ on: - '.github/FUNDING.yml' - '.github/release-drafter.yml' - '.github/ISSUE_TEMPLATE/*' + - '.github/workflows/pull-request.yaml' - '.github/workflows/release-drafter.yaml' - 'examples/*' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6911574..1ccea8e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ - Review existing issues and provide feedback or react to them. ## With pull requests: - - Open your pull request against `master`. + - Open your pull request against `dev`. - Open one pull request for only one feature/proposal, if you have several those, please put them into different PRs, whereas you are allowed to open one pull request with several bug-fixs. - Your pull request should have no more than two commits, if not, you should squash them. - It should pass all tests in the available continuous integrations systems such as TravisCI. From 89ecc3ff68a6e86851bf96ba63aabf3d1cb6ed65 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Fri, 30 Jun 2023 21:17:48 +0800 Subject: [PATCH 4/5] chore: update the workflow of "Check pull request target" --- .github/workflows/pull-request.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index d5cf385..f9bf063 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,17 +1,19 @@ name: Check pull request target on: - pull_request_target: + pull_request: types: - opened - reopened - synchronize + branches: + - master jobs: check-branches: runs-on: ubuntu-latest steps: - name: Check target branch run: | - if [ ${{ github.base_ref }} == "master" ] && [ ${{ github.head_ref }} != "dev" ]; then + if [ ${{ github.head_ref }} != "dev" ]; then echo "Only pull requests from dev branch are only allowed to be merged into master branch." exit 1 - fi \ No newline at end of file + fi From d3b35b8db26a63b7128c4c0c3514adc4ab736efd Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Fri, 30 Jun 2023 21:22:06 +0800 Subject: [PATCH 5/5] chore: update some workflows --- .github/workflows/codeql.yml | 10 ++++++++++ .../{release-drafter.yaml => release-drafter.yml} | 0 .github/workflows/test.yml | 10 ++++++---- 3 files changed, 16 insertions(+), 4 deletions(-) rename .github/workflows/{release-drafter.yaml => release-drafter.yml} (100%) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 1c73551..ad47ade 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -7,12 +7,22 @@ on: - dev paths-ignore: - '**.md' + - '.github/FUNDING.yml' + - '.github/release-drafter.yml' + - '.github/ISSUE_TEMPLATE/*' + - '.github/workflows/pull-request.yml' + - '.github/workflows/release-drafter.yml' pull_request: branches: - master - dev paths-ignore: - '**.md' + - '.github/FUNDING.yml' + - '.github/release-drafter.yml' + - '.github/ISSUE_TEMPLATE/*' + - '.github/workflows/pull-request.yml' + - '.github/workflows/release-drafter.yml' schedule: # ┌───────────── minute (0 - 59) # │ ┌───────────── hour (0 - 23) diff --git a/.github/workflows/release-drafter.yaml b/.github/workflows/release-drafter.yml similarity index 100% rename from .github/workflows/release-drafter.yaml rename to .github/workflows/release-drafter.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0b4da1d..f595e42 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,8 +10,9 @@ on: - '.github/FUNDING.yml' - '.github/release-drafter.yml' - '.github/ISSUE_TEMPLATE/*' - - '.github/workflows/pull-request.yaml' - - '.github/workflows/release-drafter.yaml' + - '.github/workflows/codeql.yml' + - '.github/workflows/pull-request.yml' + - '.github/workflows/release-drafter.yml' - 'examples/*' pull_request: branches: @@ -22,8 +23,9 @@ on: - '.github/FUNDING.yml' - '.github/release-drafter.yml' - '.github/ISSUE_TEMPLATE/*' - - '.github/workflows/pull-request.yaml' - - '.github/workflows/release-drafter.yaml' + - '.github/workflows/codeql.yml' + - '.github/workflows/pull-request.yml' + - '.github/workflows/release-drafter.yml' - 'examples/*' env: