-
Notifications
You must be signed in to change notification settings - Fork 1
feat(trunk): add trunk + workflows #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Use this file to define individuals or teams that are responsible for code in a repository. | ||
# Read more: <https://help.github.com/articles/about-codeowners/> | ||
# | ||
# Order is important: the last matching pattern takes the most precedence | ||
|
||
# These owners will be the default owners for everything | ||
* @masterpointio/masterpoint-open-source |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## what | ||
|
||
- Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?) | ||
- Use bullet points to be concise and to the point. | ||
|
||
## why | ||
|
||
- Provide the justifications for the changes (e.g. business case). | ||
- Describe why these changes were made (e.g. why do these commits fix the problem?) | ||
- Use bullet points to be concise and to the point. | ||
|
||
## references | ||
|
||
- Link to any supporting GitHub issues or helpful documentation to add some context (e.g. Stackoverflow). | ||
- Use `closes #123`, if this PR closes a GitHub issue `#123` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"extends": [ | ||
"config:best-practices", | ||
"github>aquaproj/aqua-renovate-config#2.7.5" | ||
], | ||
"enabledManagers": [ | ||
"github-actions" | ||
], | ||
"schedule": [ | ||
"after 9am on the first day of the month" | ||
], | ||
"assigneesFromCodeOwners": true, | ||
"dependencyDashboardAutoclose": true, | ||
"addLabels": ["{{manager}}"], | ||
"packageRules": [ | ||
{ | ||
"matchManagers": ["github-actions"], | ||
"matchUpdateTypes": ["minor", "patch", "pin", "digest"], | ||
"automerge": true, | ||
"automergeType": "branch", | ||
"groupName": "github-actions-auto-upgrade", | ||
"addLabels": ["auto-upgrade"] | ||
}, | ||
{ | ||
"matchManagers": ["github-actions"], | ||
"matchUpdateTypes": ["major"], | ||
"groupName": "github-actions-needs-review", | ||
"addLabels": ["needs-review"] | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Lint | ||
|
||
concurrency: | ||
group: lint-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
on: pull_request | ||
|
||
permissions: | ||
actions: read | ||
checks: write | ||
contents: read | ||
pull-requests: read | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- name: Trunk Check | ||
uses: trunk-io/trunk-action@4d5ecc89b2691705fd08c747c78652d2fc806a94 # v1.1.19 | ||
|
||
conventional-title: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Trunk Upgrade | ||
|
||
on: | ||
schedule: | ||
# On the first day of every month @ 8am | ||
- cron: 0 8 1 * * | ||
workflow_dispatch: {} | ||
|
||
permissions: read-all | ||
|
||
Comment on lines
+9
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Restrict top-level permissions to the minimum necessary. Using -permissions: read-all
+permissions:
+ contents: read 🤖 Prompt for AI Agents
|
||
jobs: | ||
trunk-upgrade: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# For trunk to create PRs | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
||
- name: Create Token for MasterpointBot App | ||
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a #v2.1.0 | ||
id: generate-token | ||
with: | ||
app_id: ${{ secrets.MP_BOT_APP_ID }} | ||
private_key: ${{ secrets.MP_BOT_APP_PRIVATE_KEY }} | ||
|
||
- name: Upgrade | ||
id: trunk-upgrade | ||
uses: trunk-io/trunk-action/upgrade@4d5ecc89b2691705fd08c747c78652d2fc806a94 # v1.1.19 | ||
with: | ||
github-token: ${{ steps.generate-token.outputs.token }} | ||
reviewers: "@masterpointio/masterpoint-internal" | ||
prefix: "chore: " | ||
|
||
- name: Merge PR automatically | ||
if: steps.trunk-upgrade.outputs.pull-request-number != '' | ||
env: | ||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | ||
PR_NUMBER: ${{ steps.trunk-upgrade.outputs.pull-request-number }} | ||
run: | | ||
gh pr merge "$PR_NUMBER" --squash --auto --delete-branch |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*out | ||
*logs | ||
*actions | ||
*notifications | ||
*tools | ||
plugins | ||
user_trunk.yaml | ||
user.yaml | ||
tmp |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Autoformatter friendly markdownlint config (all formatting rules disabled) | ||
default: true | ||
blank_lines: false | ||
bullet: false | ||
html: false | ||
indentation: false | ||
line_length: false | ||
spaces: false | ||
url: false | ||
whitespace: false | ||
|
||
# Disable MD025: Multiple top-level headings in the same file | ||
MD025: false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
rules: | ||
quoted-strings: | ||
required: only-when-needed | ||
extra-allowed: ["{|}"] | ||
empty-values: | ||
forbid-in-block-mappings: true | ||
forbid-in-flow-mappings: true | ||
key-duplicates: {} | ||
octal-values: | ||
forbid-implicit-octal: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
plugins: [ | ||
{ | ||
name: "preset-default", | ||
params: { | ||
overrides: { | ||
removeViewBox: false, // https://github.com/svg/svgo/issues/1128 | ||
sortAttrs: true, | ||
removeOffCanvasPaths: true, | ||
}, | ||
}, | ||
}, | ||
], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version: 0.1 | ||
cli: | ||
version: 1.22.15 | ||
plugins: | ||
sources: | ||
- id: trunk | ||
ref: v1.6.8 | ||
uri: https://github.com/trunk-io/plugins | ||
lint: | ||
enabled: | ||
- checkov@3.2.427 | ||
- trufflehog@3.88.30 | ||
- git-diff-check | ||
- gitleaks@8.26.0 | ||
- markdownlint@0.45.0 | ||
- oxipng@9.1.5 | ||
- prettier@3.5.3 | ||
- svgo@3.3.2 | ||
- taplo@0.9.3 | ||
- yamllint@1.37.1 | ||
ignore: | ||
- linters: [ALL] | ||
paths: | ||
- "**/PULL_REQUEST_TEMPLATE.md" | ||
runtimes: | ||
enabled: | ||
- go@1.21.0 | ||
- node@18.20.5 | ||
- python@3.10.8 | ||
actions: | ||
disabled: | ||
- trunk-announce | ||
- trunk-check-pre-push | ||
- trunk-fmt-pre-commit | ||
enabled: | ||
- trunk-upgrade-available |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add a top-level heading to comply with Markdown best practices
The PR template should begin with a top-level heading (using #) to improve document structure and comply with Markdown standards. This would also provide a clear title for the PR in GitHub's interface.
📝 Committable suggestion
🧰 Tools
🪛 GitHub Check: Trunk Check
[notice] 1-1: markdownlint(MD041)
[new] First line in a file should be a top-level heading
🤖 Prompt for AI Agents