From 4b35829cc09db12e86c9737f157db427dbc0edad Mon Sep 17 00:00:00 2001 From: Tristan Rivoallan Date: Sun, 6 Oct 2024 23:02:48 +0200 Subject: [PATCH] chore(ci): trunk conf (#6) * ci(repository): enable issues * ci: recommend conventional commits vscode extension * ci: recommand github actions and PR vscode extensions * ci: require ZERO PR approvals * chore: typo * ci: enable and configure trunk.io * chore: typo * Merge branch 'main' of https://github.com/constructions-incongrues/plomberie into trivoallan/issue2 * feat(ci): code quality checks with trunk.io Fixes #2 * chore: forgotten in previous commit * ci(repository): make trunk checks required for PR merge --- .github/settings.yml | 12 ++++-------- .github/workflows/trunk-check.yaml | 23 +++++++++++++++++++++++ README.md | 1 + 3 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/trunk-check.yaml diff --git a/.github/settings.yml b/.github/settings.yml index 01ae699..e586606 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -8,12 +8,10 @@ repository: - boilerplate visibility: public has_issues: true # - has_issues: true # has_projects: false has_wiki: false has_discussions: false is_template: true - is_template: true default_branch: main allow_squash_merge: true allow_merge_commit: false @@ -41,12 +39,10 @@ branches: # required_approving_review_count: 1 # dismiss_stale_reviews: true # require_code_owner_reviews: true - required_status_checks: - ~ # null to disable - # strict: true - # contexts: - # - Check dist/ - # - TypeScript Tests + required_status_checks: # null to disable + strict: true + contexts: + - Trunk Check enforce_admins: true restrictions: null required_linear_history: true diff --git a/.github/workflows/trunk-check.yaml b/.github/workflows/trunk-check.yaml new file mode 100644 index 0000000..d88dda5 --- /dev/null +++ b/.github/workflows/trunk-check.yaml @@ -0,0 +1,23 @@ +name: Pull Request + +on: [pull_request] +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: read-all + +jobs: + trunk_check: + name: Trunk Code Quality Runner + runs-on: ubuntu-latest + permissions: + checks: write # For trunk to post annotations + contents: read # For repo checkout + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Trunk Code Quality + uses: trunk-io/trunk-action@v1 diff --git a/README.md b/README.md index fcdebec..1e4e338 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ ## Features +- [ ] Code quality checks using [trunk.io](https://trunk.io/code-quality) - [ ] Github Flow - [ ] Code quality checks using [trunk.io](https://trunk.io/code-quality) - [ ] main branch deploys to github pages