commit 1fed71dc64c01bfe94a17249f5dc4fa93f9b2faa Author: tienbh Date: Wed Nov 18 11:33:23 2026 +0700 Init diff --git a/.gitea/.gitkeep b/.gitea/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.gitea/scoped_workflows/scan-vulnerabilities.yaml b/.gitea/scoped_workflows/scan-vulnerabilities.yaml new file mode 100644 index 0000000..92394b3 --- /dev/null +++ b/.gitea/scoped_workflows/scan-vulnerabilities.yaml @@ -0,0 +1,32 @@ +name: Scan Vulnerabilities + +on: + workflow_dispatch: + schedule: + - cron: "0 2 * * 1" # At 02:00 on Monday + push: + branches: [main] + +jobs: + sbom-upload: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v7 + + - name: Generate SBOM using Anchore (CycloneDX) + uses: anchore/sbom-action@v0 + with: + format: cyclonedx-json + output-file: sbom.json + upload-artifact: false + + - name: Upload SBOM to Dependency-Track + uses: DependencyTrack/gh-upload-sbom@v4 + with: + server-hostname: "${{ vars.DT_HOSTNAME }}" + api-key: "${{ secrets.DT_API_KEY }}" + project-name: "${{ github.repository }}" + project-version: "latest" + bom-filename: "sbom.json" + auto-create: true diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..1beebfa --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,40 @@ +name: Release + +on: + push: + tags: + - "**" + +permissions: + contents: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + release: + runs-on: ubuntu-latest + name: Release + + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + + # Gitea's GITHUB_TOKEN is rejected by api.github.com. Pass a github.com PAT instead. + - name: Generate release notes + uses: orhun/git-cliff-action@v4 + with: + config: cliff.toml + args: --latest --strip header + github_token: ${{ secrets.PAT_GITHUB }} + env: + OUTPUT: release-notes.md + + - name: Create release + uses: softprops/action-gh-release@v3 + with: + token: ${{ secrets.RELEASE_TOKEN }} + prerelease: true + body_path: release-notes.md \ No newline at end of file diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 0000000..66ae8d0 --- /dev/null +++ b/cliff.toml @@ -0,0 +1,71 @@ +# git-cliff configuration — https://git-cliff.org/docs/configuration +# Preview locally: npx git-cliff --latest (or: npx git-cliff v0.6.1..v0.7.0) + +[changelog] +header = "" +# Group names carry an HTML comment prefix so sections sort in a fixed order; `striptags` removes it when rendering. +body = """ +{%- set server = get_env(name="GITHUB_SERVER_URL", default="") -%} +{%- set repository = get_env(name="GITHUB_REPOSITORY", default="") -%} +{% if version %}\ +# Release Notes for {{ version }} +{% else %}\ +# Unreleased +{% endif %} +{%- set breaking_commits = commits | filter(attribute="breaking", value=true) %} +{% if breaking_commits | length > 0 %} +## :warning: Breaking changes +{% for commit in breaking_commits %} +- {% if commit.scope %}**{{ commit.scope }}**: {% endif %}{{ commit.breaking_description | default(value=commit.message) | upper_first }} ({{ commit.id | truncate(length=7, end="") }}) +{%- endfor %} +{% endif %} +{%- for group, group_commits in commits | group_by(attribute="group") %} +## {{ group | striptags | trim }} +{% for commit in group_commits %} +- {% if commit.scope %}**{{ commit.scope }}**: {% endif %}{{ commit.message | upper_first }} ({{ commit.id | truncate(length=7, end="") }}) +{%- endfor %} +{% endfor %} +{%- set authors = commits | map(attribute="author.name") | unique | sort %} +{% if authors | length > 0 %} +## Contributors +{% for author in authors %} +* {{ author }} +{%- endfor %} +{% endif %} +{% if server and repository and version %} +{%- if previous.version %} +**Full Changelog**: [{{ previous.version }}...{{ version }}]({{ server }}/{{ repository }}/compare/{{ previous.version }}...{{ version }}) +{%- else %} +**Full Changelog**: [{{ version }}]({{ server }}/{{ repository }}/commits/tag/{{ version }}) +{%- endif %} +{% endif %} +""" +footer = "" +trim = true +postprocessors = [ + { pattern = '\n{3,}', replace = "\n\n" }, +] + +[git] +conventional_commits = true +# Drops merge/squash commits such as "Develop (!259)" or "Merge Develop into Main (!250)". +filter_unconventional = true +split_commits = false +protect_breaking_commits = true +filter_commits = false +tag_pattern = "v[0-9].*" +sort_commits = "newest" +commit_parsers = [ + { message = "^(?i)merge", skip = true }, + { message = "^(?i)feat", group = ":rocket: Features" }, + { message = "^(?i)(fix|hotfix)", group = ":bug: Bug Fixes" }, + { message = "^(?i)(improve|enhancement|perf)", group = ":zap: Improvements" }, + { message = "^(?i)refactor", group = ":recycle: Refactor" }, + { message = "^(?i)migration", group = ":card_file_box: Database Migrations" }, + { message = "^(?i)docs?", group = ":memo: Documentation" }, + { message = "^(?i)style", group = ":art: Styling" }, + { message = "^(?i)test", group = ":white_check_mark: Tests" }, + { message = "^(?i)(ci|build)", group = ":construction_worker: CI/CD" }, + { message = "^(?i)chore", group = ":wrench: Chores" }, + { message = ".*", group = ":card_index: Other" }, +]