diff --git a/.github/workflows/cr.yml b/.github/workflows/cr.yml new file mode 100644 index 0000000..b12c144 --- /dev/null +++ b/.github/workflows/cr.yml @@ -0,0 +1,28 @@ +name: Code Review + +permissions: + contents: read + pull-requests: write + +on: + pull_request: + types: [opened, reopened, synchronize] + +jobs: + CodeReview: + # if: ${{ contains(github.event.*.labels.*.name, 'gpt review') }} # Optional; to run only when a label is attached + runs-on: ubuntu-latest + steps: + - uses: anc95/ChatGPT-CodeReview@main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + # Optional + LANGUAGE: Spanish + OPENAI_API_ENDPOINT: https://api.openai.com/v1 + MODEL: gpt-4o-mini # https://platform.openai.com/docs/models + PROMPT: # example: Please check if there are any confusions or irregularities in the following code diff: + top_p: 1 # https://platform.openai.com/docs/api-reference/chat/create#chat/create-top_p + temperature: 1 # https://platform.openai.com/docs/api-reference/chat/create#chat/create-temperature + max_tokens: 10000 + MAX_PATCH_LENGTH: 10000 # if the patch/diff length is large than MAX_PATCH_LENGTH, will be ignored and won't review. By default, with no MAX_PATCH_LENGTH set, there is also no limit for the patch/diff length. diff --git a/.github/workflows/pr_develop.yml b/.github/workflows/pr_develop.yml new file mode 100644 index 0000000..8ebae26 --- /dev/null +++ b/.github/workflows/pr_develop.yml @@ -0,0 +1,21 @@ +name: 'Gitflow in Dev' + +permissions: + contents: read + pull-requests: write + +on: + pull_request: + types: [opened, reopened, synchronize] + branches: + - develop + +jobs: + Gitflow-develop-rules: + runs-on: ubuntu-latest + steps: + - uses: deepakputhraya/action-branch-name@master + with: + regex: '[a-z]*/.*' + ignore: develop + allowed_prefixes: 'feature,backport,dependabot' diff --git a/.github/workflows/pr_hotfix.yml b/.github/workflows/pr_hotfix.yml new file mode 100644 index 0000000..fb3c9b1 --- /dev/null +++ b/.github/workflows/pr_hotfix.yml @@ -0,0 +1,15 @@ +name: 'Gitflow in Hotfix' + +on: + pull_request: + types: [opened, reopened] + branches: + - 'hotfix/**' + +jobs: + Gitflow-hotfix-rules: + runs-on: ubuntu-latest + steps: + - uses: deepakputhraya/action-branch-name@master + with: + regex: 'master' diff --git a/.github/workflows/pr_master.yml b/.github/workflows/pr_master.yml new file mode 100644 index 0000000..e81178d --- /dev/null +++ b/.github/workflows/pr_master.yml @@ -0,0 +1,17 @@ +name: 'Gitflow in Master' + +on: + pull_request: + types: [opened, reopened] + branches: + - master + +jobs: + Gitflow-master-rules: + runs-on: ubuntu-latest + steps: + - uses: deepakputhraya/action-branch-name@master + with: + regex: '[a-z]*/.*' + ignore: master + allowed_prefixes: 'release,hotfix' diff --git a/.github/workflows/pr_release.yml b/.github/workflows/pr_release.yml new file mode 100644 index 0000000..3af20b3 --- /dev/null +++ b/.github/workflows/pr_release.yml @@ -0,0 +1,15 @@ +name: 'Gitflow in Release' + +on: + pull_request: + types: [opened, reopened] + branches: + - 'releases/**' + +jobs: + Gitflow-release-rules: + runs-on: ubuntu-latest + steps: + - uses: deepakputhraya/action-branch-name@master + with: + regex: 'develop'