diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 0000000..623c3bf --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,86 @@ +language: zh-CN +tone_instructions: '' +early_access: false +enable_free_tier: true +reviews: + profile: chill + request_changes_workflow: false + high_level_summary: true + high_level_summary_placeholder: '@coderabbitai summary' + auto_title_placeholder: '@coderabbitai' + review_status: true + poem: true + collapse_walkthrough: false + sequence_diagrams: true + labeling_instructions: [] + path_filters: [] + path_instructions: [] + abort_on_close: true + auto_review: + enabled: true + auto_incremental_review: true + ignore_title_keywords: [] + labels: [] + drafts: false + base_branches: [] + tools: + shellcheck: + enabled: true + ruff: + enabled: true + markdownlint: + enabled: true + github-checks: + enabled: true + timeout_ms: 90000 + languagetool: + enabled: true + enabled_only: false + level: default + biome: + enabled: true + hadolint: + enabled: true + swiftlint: + enabled: true + phpstan: + enabled: true + level: default + golangci-lint: + enabled: true + yamllint: + enabled: true + gitleaks: + enabled: true + checkov: + enabled: true + detekt: + enabled: true + eslint: + enabled: true + rubocop: + enabled: true + buf: + enabled: true + regal: + enabled: true + actionlint: + enabled: true + pmd: + enabled: true + cppcheck: + enabled: true +chat: + auto_reply: true +knowledge_base: + opt_out: false + learnings: + scope: auto + issues: + scope: auto + jira: + project_keys: [] + linear: + team_keys: [] + pull_requests: + scope: auto diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index fe9d158..df11d03 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -4,6 +4,10 @@ on: pull_request: branches: - master + types: + - reopened + - opened + - synchronize permissions: contents: read @@ -11,45 +15,50 @@ permissions: pull-requests: write jobs: - labeler: + labeler-content: + name: Label for PR content if: github.repository == 'skyclouds2001/springboot-template-sky' timeout-minutes: 60 runs-on: ubuntu-latest steps: - - name: Label for PR content - uses: actions/labeler@v5 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/labeler@v5.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} labeler-size: + name: Label for PR size if: github.repository == 'skyclouds2001/springboot-template-sky' timeout-minutes: 60 runs-on: ubuntu-latest steps: - - name: Label for PR size - uses: codelytv/pr-size-labeler@v1 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - github_api_url: https://api.github.com - xs_label: size/xs - xs_max_size: 10 - s_label: size/s - s_max_size: 100 - m_label: size/m - m_max_size: 500 - l_label: size/l - l_max_size: 1000 - xl_label: size/xl - fail_if_xl: false - message_if_xl: '' + - uses: codelytv/pr-size-labeler@v1.10.1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + github_api_url: https://api.github.com + xs_label: size/xs + xs_max_size: 10 + s_label: size/s + s_max_size: 100 + m_label: size/m + m_max_size: 500 + l_label: size/l + l_max_size: 1000 + xl_label: size/xl + fail_if_xl: false + message_if_xl: | + This PR exceeds the recommended size of 1000 lines. + Please make sure you are NOT addressing multiple issues with one PR. + Note this PR might be rejected due to its size. label-rebase-needed: - if: github.repository == 'skyclouds2001/big-data-monitor-system' + name: Label for PR merge conflict + if: github.repository == 'skyclouds2001/springboot-template-sky' timeout-minutes: 60 runs-on: ubuntu-latest steps: - - name: Label for PR merge conflict - uses: eps1lon/actions-label-merge-conflict@v3 - with: - dirtyLabel: merge conflicts - repoToken: ${{ secrets.GITHUB_TOKEN }} - commentOnDirty: 'This pull request has conflicts, please resolve those before we can evaluate the pull request.' - commentOnClean: 'Conflicts have been resolved. A maintainer will review the pull request shortly.' + - uses: eps1lon/actions-label-merge-conflict@v3.0.2 + with: + dirtyLabel: merge conflicts + repoToken: ${{ secrets.GITHUB_TOKEN }} + commentOnDirty: | + This pull request has conflicts, please resolve those before we can evaluate the pull request. + commentOnClean: | + Conflicts have been resolved. A maintainer will review the pull request shortly. diff --git a/.github/workflows/new-contributor.yml b/.github/workflows/new-contributor.yml index 899e149..7efbe13 100644 --- a/.github/workflows/new-contributor.yml +++ b/.github/workflows/new-contributor.yml @@ -1,21 +1,28 @@ name: new contributor on: - - issues - - pull_request + issues: + types: + - reopened + - opened + pull_request: + types: + - reopened + - opened permissions: contents: none - issues: none + issues: write pull-requests: write jobs: new-contributor: + name: Welcome new contributor if: github.repository == 'skyclouds2001/springboot-template-sky' timeout-minutes: 60 runs-on: ubuntu-latest steps: - - uses: actions/first-interaction@v1 + - uses: actions/first-interaction@v1.3.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} issue-message: | diff --git a/.github/workflows/project-automate.yml b/.github/workflows/project-automate.yml new file mode 100644 index 0000000..89e89a9 --- /dev/null +++ b/.github/workflows/project-automate.yml @@ -0,0 +1,24 @@ +name: project automate + +on: + issues: + types: + - opened + - reopened + - transferred + pull_request: + types: + - opened + - reopened + +jobs: + add-to-project: + name: Add issue or pull request to project + if: github.repository == 'skyclouds2001/springboot-template-sky' + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/add-to-project@v1.0.0 + with: + project-url: https://github.com/users/skyclouds2001/projects/2 + github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cf02667 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: release + +on: + push: + tags: + - v* + +permissions: + contents: write + +jobs: + github-release: + name: Publish github release + if: github.repository == 'skyclouds2001/springboot-template-sky' + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.7 + - uses: softprops/action-gh-release@v2.0.8 + with: + body: | + Please refer to [CHANGELOG.md](https://github.com/skyclouds2001/springboot-template-sky/blob/master/CHANGELOG.md) for details. diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 3308a57..28ce646 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -2,22 +2,27 @@ name: stale on: schedule: - - cron: '30 1 * * *' + - cron: 0 0 * * * permissions: - contents: none + contents: write issues: write pull-requests: write jobs: stale: + name: Stale issue or pull request if have had no activity for a long time if: github.repository == 'skyclouds2001/springboot-template-sky' timeout-minutes: 60 runs-on: ubuntu-latest steps: - - uses: actions/stale@v9 + - uses: actions/stale@v9.0.0 with: - stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.' - stale-pr-message: 'This pr is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.' - days-before-stale: 30 - days-before-close: 5 + stale-issue-message: | + This issue is stale because it has been open for 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. + stale-pr-message: | + This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. + close-issue-message: | + This issue was closed because it has been stalled for 7 days with no activity. + close-pr-message: | + This PR was closed because it has been stalled for 7 days with no activity. diff --git a/checkstyle.xml b/checkstyle.xml new file mode 100644 index 0000000..77e6a1d --- /dev/null +++ b/checkstyle.xml @@ -0,0 +1,293 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml index b9567e7..c3034e7 100644 --- a/pom.xml +++ b/pom.xml @@ -216,14 +216,157 @@ + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.5.0 + + checkstyle.xml + UTF-8 + true + true + false + error + + + + codestyle-validate + validate + + check + + + + + + com.github.spotbugs + spotbugs-maven-plugin + 4.8.6.0 + + Max + Low + + + + spotbugs-test + test + + check + + + + + + org.apache.maven.plugins + maven-pmd-plugin + 3.25.0 + + + /category/java/bestpractices.xml + + true + + + + pmd-package + package + + check + + + + pmd-site + site + + cpd + + + + + + org.springframework.boot spring-boot-maven-plugin + + org.apache.maven.plugins + maven-checkstyle-plugin + + + com.github.spotbugs + spotbugs-maven-plugin + + + org.apache.maven.plugins + maven-pmd-plugin + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.5.0 + + checkstyle.xml + UTF-8 + true + true + false + error + + + + + check + + + + + + com.github.spotbugs + spotbugs-maven-plugin + 4.8.6.0 + + Max + Low + + + + + check + + + + + + org.apache.maven.plugins + maven-pmd-plugin + 3.25.0 + + + /category/java/bestpractices.xml + + true + + + + + pmd + cpd + + + + + + + dev