From 55c833ecd7991f6f0b59f15555d947d99dc995b2 Mon Sep 17 00:00:00 2001 From: whereareiam Date: Fri, 23 Oct 2026 08:19:48 +0200 Subject: [PATCH] chore(github): align templates, labels and workflows with the other repositories The repository used the upstream fork's setup while chronica, fabrica and Identica share one through whereareiam/devops: - Pull request checks move to pull-request-checks.yml and a reusable verify workflow, run for every pull request (stacked ones included) and skip drafts. - The title and label check uses devops' validate-metadata, which also checks the "Area: Description" title. - The release drafter uses the shared categories and regroups the draft by area, taking the summary and compatibility section from .github/release-notes.md. - A pull request template, Dependabot for npm and GitHub Actions, and bug report and suggestion templates whose labels exist; the upstream templates applied labels the repository does not have. - CONTRIBUTING documents the past-tense titles, the areas and labels. Co-Authored-By: Claude Opus 5.5 --- .github/ISSUE_TEMPLATE/1-style-bug-report.yml | 91 ------------------- .github/ISSUE_TEMPLATE/3-core-bug-report.yml | 43 --------- .github/ISSUE_TEMPLATE/3-doc-report.yml | 12 --- .github/ISSUE_TEMPLATE/4-feature-request.yml | 39 -------- .github/ISSUE_TEMPLATE/bug_report.yml | 64 +++++++++++++ .github/ISSUE_TEMPLATE/feature_request.yml | 45 +++++++++ .github/dependabot.yml | 22 +++++ .github/pull_request_template.md | 23 +++++ .github/release-drafter.yml | 69 +++++++------- .github/release-notes.md | 11 +++ .github/workflows/pull-request-checks.yml | 21 +++++ .github/workflows/pull-request-metadata.yml | 23 +++++ .github/workflows/release-drafter.yml | 28 ++++-- .../{pull-request.yml => reusable-verify.yml} | 58 +++--------- CONTRIBUTING.md | 49 ++++++++-- 15 files changed, 318 insertions(+), 280 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/1-style-bug-report.yml delete mode 100644 .github/ISSUE_TEMPLATE/3-core-bug-report.yml delete mode 100644 .github/ISSUE_TEMPLATE/3-doc-report.yml delete mode 100644 .github/ISSUE_TEMPLATE/4-feature-request.yml create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/dependabot.yml create mode 100644 .github/pull_request_template.md create mode 100644 .github/release-notes.md create mode 100644 .github/workflows/pull-request-checks.yml create mode 100644 .github/workflows/pull-request-metadata.yml rename .github/workflows/{pull-request.yml => reusable-verify.yml} (59%) diff --git a/.github/ISSUE_TEMPLATE/1-style-bug-report.yml b/.github/ISSUE_TEMPLATE/1-style-bug-report.yml deleted file mode 100644 index fa1d5adc..00000000 --- a/.github/ISSUE_TEMPLATE/1-style-bug-report.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: Style bug report -description: Color/position errors occur after installing the theme. -labels: ["style bug"] -body: - - type: markdown - attributes: - value: | - !!! Please read the readme and ensure that the theme is used correctly before submitting !!! - 1. Please use the latest theme and refresh the page with Ctrl+F5 to see if the Bug has disappeared. - 2. Please check the project's release notes for descriptions of fixes related to this bug. - 3. If there are related descriptions, you can check if the Bug has been fixed by compiling the development version yourself in the README.md. - 4. Please check if there is the same error in the default Forgejo theme, confirming that it is not a theme problem. - - type: input - id: theme-version - attributes: - label: Theme Version - description: - The version of the theme, if it is a development version, you can check the value of `--theme-version` in the - CSS file, or check the `package.json` file in the project root directory. - placeholder: ex. 1.24.5 - validations: - required: true - - type: input - id: forgejo-version - attributes: - label: Forgejo Version - description: What version of Forgejo are you using? - placeholder: ex. 1.24.5 - validations: - required: true - - type: input - id: page - attributes: - label: Page - description: The page where the error occurred. - placeholder: Issue list page - validations: - required: true - - type: textarea - id: actual-behavior - attributes: - label: Actual Behavior - description: Please describe the actual error presentation. - placeholder: The color of the bottom of the page is incorrect - validations: - required: true - - type: textarea - id: expected-behavior - attributes: - label: Expected Behavior - description: Please describe the expected correct presentation. - placeholder: The color of the bottom of the page should be white - validations: - required: true - - type: textarea - id: theme-screenshot - attributes: - label: Screenshot of the theme applied - description: Please upload a screenshot of the theme applied. - validations: - required: true - - type: textarea - id: steps-to-reproduce - attributes: - label: Steps to reproduce - description: Please describe how to reproduce the error. - placeholder: 1. Install the theme 2. Refresh the page 3. View the error - validations: - required: false - - type: textarea - id: bug-description - attributes: - label: Bug Description - description: Please describe the specific presentation of the error. - placeholder: The color of the bottom of the page is incorrect - validations: - required: false - - type: textarea - id: forgejo-screenshot - attributes: - label: Screenshot of the default Forgejo theme - description: Please upload a screenshot of the default Forgejo theme. - validations: - required: false - - type: textarea - id: github-screenshot - attributes: - label: Screenshot of the corresponding GitHub page - description: Please upload a screenshot of the corresponding GitHub page. - validations: - required: false diff --git a/.github/ISSUE_TEMPLATE/3-core-bug-report.yml b/.github/ISSUE_TEMPLATE/3-core-bug-report.yml deleted file mode 100644 index 684a6e46..00000000 --- a/.github/ISSUE_TEMPLATE/3-core-bug-report.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Core bug report -description: Report errors in the theme framework. -labels: ["core bug"] -body: - - type: textarea - id: actual-behavior - attributes: - label: Actual Behavior - description: Please describe the actual error presentation. - placeholder: No automatic color theme generated - validations: - required: true - - type: textarea - id: expected-behavior - attributes: - label: Expected Behavior - description: Please describe the expected correct presentation. - placeholder: Generate automatic color theme - validations: - required: true - - type: textarea - id: steps-to-reproduce - attributes: - label: Steps to reproduce - description: Please describe how to reproduce the error. - placeholder: 1. Create a color theme 2. Compile the theme 3. View the error - validations: - required: false - - type: textarea - id: bug-description - attributes: - label: Bug Description - description: Please describe the specific presentation of the error. - placeholder: No automatic color theme generated - validations: - required: false - - type: textarea - id: screenshot - attributes: - label: Screenshot - description: Please upload the screenshot of the error. - validations: - required: false diff --git a/.github/ISSUE_TEMPLATE/3-doc-report.yml b/.github/ISSUE_TEMPLATE/3-doc-report.yml deleted file mode 100644 index b06ad5d4..00000000 --- a/.github/ISSUE_TEMPLATE/3-doc-report.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Document report -description: Improve or supplement the document. -labels: ["documentation"] -body: - - type: textarea - id: doc-description - attributes: - label: Document Description - description: Please describe the specific content of the document. - placeholder: The document content is incorrect - validations: - required: true diff --git a/.github/ISSUE_TEMPLATE/4-feature-request.yml b/.github/ISSUE_TEMPLATE/4-feature-request.yml deleted file mode 100644 index 9fe0a2f2..00000000 --- a/.github/ISSUE_TEMPLATE/4-feature-request.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Feature request -description: Suggest new features. -labels: ["enhancement"] -body: - - type: markdown - attributes: - value: | - 1. We do not accept style requests that are not Gitea or GitHub. - 2. Color requests are best implemented by yourself. - - type: input - id: page - attributes: - label: Page - description: The page the feature involves. - placeholder: Home page - validations: - required: false - - type: textarea - id: feature-description - attributes: - label: Feature Description - description: Please describe the feature you want. - placeholder: Menu style modification - validations: - required: true - - type: textarea - id: screenshot - attributes: - label: Screenshot - description: Expected theme effect. - validations: - required: false - - type: textarea - id: github-screenshot - attributes: - label: Screenshot of the corresponding GitHub page - description: Please upload a screenshot of the corresponding GitHub page. - validations: - required: false diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..b676d117 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,64 @@ +name: Bug report +description: A page looks or behaves differently from GitHub, or breaks, with the theme installed. +labels: + - bug +body: + - type: input + id: version + attributes: + label: Theme version + description: + For example `0.5.0`, or `dev` for a build from source. A built stylesheet names it in `--theme-version`. + validations: + required: true + + - type: input + id: forgejo-version + attributes: + label: Forgejo version + placeholder: "17.0.0" + validations: + required: true + + - type: dropdown + id: installation + attributes: + label: Installation + options: + - Stylesheets and template overrides + - Stylesheets only + validations: + required: true + + - type: input + id: page + attributes: + label: Page + description: The page and its address, for example the issue list at `/owner/repo/issues`. + validations: + required: true + + - type: textarea + id: steps + attributes: + label: Steps to reproduce + placeholder: | + 1. Open the issue list + 2. Narrow the window to phone width + validations: + required: true + + - type: textarea + id: expected + attributes: + label: Expected and actual behavior + validations: + required: true + + - type: textarea + id: media + attributes: + label: Screenshots + description: >- + The page with the theme and, if you can, the same page on GitHub and in Forgejo's default theme. Hide names or + tokens you do not want to share. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 00000000..a2720e5b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,45 @@ +name: Suggestion +description: Suggest a page or behavior the theme should match, or a change to the existing look. +labels: + - feature +body: + - type: textarea + id: problem + attributes: + label: Problem + description: What looks or works differently from GitHub today, and where. + validations: + required: true + + - type: textarea + id: solution + attributes: + label: Proposed solution + description: How the theme could solve it. A link to or screenshot of the GitHub page helps. + validations: + required: true + + - type: textarea + id: alternatives + attributes: + label: Alternatives + description: Workarounds or other solutions you considered. + + - type: dropdown + id: area + attributes: + label: Area + options: + - Actions + - Code + - Dashboard + - Issues + - Navigation + - Organizations + - Profile + - Projects + - Pull requests + - Releases + - Settings + - Themes + - Other diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..fbac518b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,22 @@ +version: 2 +updates: + # bun.lock is not committed, so Dependabot updates package.json through the npm ecosystem. + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "Dependency" + open-pull-requests-limit: 10 + labels: + - "dependencies" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "Dependency" + open-pull-requests-limit: 5 + labels: + - "dependencies" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..25d18248 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,23 @@ +## Summary + + + +## Before and after + + + +## Release notes + + + +- [ ] The title follows `Area: Description` with a listed area +- [ ] The title describes the effect in the past tense, for example `Branches: Fixed ...` +- [ ] Exactly one label: `feature`, `change`, `bug`, `dependencies`, or `skip-changelog` +- [ ] `bug` only for a bug that shipped in a release; a fix for a bug that only existed on `dev` is `skip-changelog` +- [ ] `major` added when admins must act on upgrade, for example a new minimum Forgejo version +- [ ] Upgrade steps or warnings added to `.github/release-notes.md`, if admins need them + +## Checks + +- [ ] Tests added or updated +- [ ] Checked in the dev preview at desktop and phone width, in dark and light mode diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 2818b10d..23b4a333 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,60 +1,59 @@ name-template: "$RESOLVED_VERSION" tag-template: "$RESOLVED_VERSION" -change-template: "* $TITLE by @$AUTHOR in [#$NUMBER]($URL)" +# The release drafter workflow sorts the changes by their title prefix. +change-template: "* $TITLE ([#$NUMBER]($URL))" change-title-escapes: "\\<*_&" category-template: "## $TITLE" no-changes-template: "* No changes" - +# The text between the markers comes from .github/release-notes.md when it names the resolved version. template: | - # Release $RESOLVED_VERSION + + # Forgejo GitHub Theme $RESOLVED_VERSION - [Short subtitle] - - [Short summary of the release.] + [1-2 sentence summary of the release.] # Compatibility - This release targets Forgejo `[major version]`. - - It was tested against Forgejo `[version]`, including the bundled template overrides. + This release targets Forgejo `[major version]`. It was tested against Forgejo `[version]`, including the bundled + template overrides. + # Changelog $CHANGES + **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$RESOLVED_TAG + categories: - - title: "Features" + - type: pre-exclude + when: + label: skip-changelog + + - title: "What’s new" exclusive: true - labels: - - "feature" + semver-increment: minor + when: + label: feature - - title: "Changes" + - title: "Enhancements" exclusive: true - labels: - - "change" + when: + label: change - title: "Fixes" exclusive: true - labels: - - "bug" + when: + label: bug - title: "Dependencies" exclusive: true - labels: - - "dependencies" - -exclude-labels: - - "skip-changelog" - -version-resolver: - major: - labels: - - "major" - minor: - labels: - - "feature" - patch: - labels: - - "change" - - "bug" - - "dependencies" - default: patch + when: + label: dependencies + + - type: version-resolver + semver-increment: major + when: + label: major + + - type: version-resolver + semver-increment: patch diff --git a/.github/release-notes.md b/.github/release-notes.md new file mode 100644 index 00000000..912358c6 --- /dev/null +++ b/.github/release-notes.md @@ -0,0 +1,11 @@ +--- +version: 0.5.0 +--- + +# Forgejo GitHub Theme 0.5.0 - [Short subtitle] + +[1-2 sentence summary of the release.] + +# Compatibility + +This release targets Forgejo `17`. It was tested against Forgejo `17.0.0`, including the bundled template overrides. diff --git a/.github/workflows/pull-request-checks.yml b/.github/workflows/pull-request-checks.yml new file mode 100644 index 00000000..fe61dc5d --- /dev/null +++ b/.github/workflows/pull-request-checks.yml @@ -0,0 +1,21 @@ +name: Pull request · Checks + +# Every pull request, whatever its base, so a pull request stacked on another one is checked too. +on: + pull_request: + types: [opened, reopened, synchronize, ready_for_review] + +concurrency: + group: pull-request-checks-${{ github.event.pull_request.number }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + checks: + name: Checks + if: ${{ !github.event.pull_request.draft }} + uses: ./.github/workflows/reusable-verify.yml + with: + ref: ${{ github.sha }} diff --git a/.github/workflows/pull-request-metadata.yml b/.github/workflows/pull-request-metadata.yml new file mode 100644 index 00000000..22311674 --- /dev/null +++ b/.github/workflows/pull-request-metadata.yml @@ -0,0 +1,23 @@ +name: Pull request · Metadata + +on: + pull_request_target: + types: [opened, reopened, edited, synchronize, labeled, unlabeled] + +concurrency: + group: pull-request-metadata-${{ github.event.pull_request.number }} + cancel-in-progress: true + +permissions: + pull-requests: read + +jobs: + metadata: + name: Title and labels + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + # Reads the pull request through the API and never checks out its code. + - uses: whereareiam/devops/primitive/pull-request/validate-metadata@v3 + with: + title-format: "Area: Description" diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index d4ab36e0..f046f819 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -1,4 +1,4 @@ -name: Release Drafter +name: Release drafter on: push: @@ -10,17 +10,31 @@ permissions: contents: write pull-requests: read -concurrency: - group: release-drafter-${{ github.ref }} - cancel-in-progress: true - jobs: - update-release-draft: + # A newer push makes an older draft update pointless, so it cancels it. + draft: + name: Update draft runs-on: ubuntu-latest + concurrency: + group: release-drafter-${{ github.ref }} + cancel-in-progress: true steps: - - name: Update release draft + - uses: actions/checkout@v7 + with: + ref: dev + persist-credentials: false + + - id: drafter uses: release-drafter/release-drafter@v7 with: commitish: dev env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Group changes and add the release notes + uses: whereareiam/devops/primitive/release/draft/regroup@v3 + with: + release-id: ${{ steps.drafter.outputs.id }} + release-body: ${{ steps.drafter.outputs.body }} + notes-file: .github/release-notes.md + version: ${{ steps.drafter.outputs.resolved_version }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/reusable-verify.yml similarity index 59% rename from .github/workflows/pull-request.yml rename to .github/workflows/reusable-verify.yml index bf8ac7b3..0f27a687 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/reusable-verify.yml @@ -1,57 +1,26 @@ -name: Pull Request +name: Verify on: - pull_request: - types: - - opened - - edited - - reopened - - synchronize - - ready_for_review - branches: - - dev - pull_request_target: - types: - - opened - - edited - - reopened - - synchronize - - labeled - - unlabeled - - ready_for_review - branches: - - dev + workflow_call: + inputs: + ref: + description: Commit, branch or tag to verify. + required: true + type: string -concurrency: - group: pr-${{ github.event_name }}-${{ github.event.pull_request.number }} - cancel-in-progress: true +permissions: + contents: read jobs: - require-release-label: - if: github.event_name == 'pull_request_target' - runs-on: ubuntu-latest - permissions: - issues: read - pull-requests: read - steps: - - name: Verify pull request release label - uses: mheap/github-action-required-labels@v5 - with: - mode: exactly - count: 1 - labels: "^(feature|change|bug|dependencies|skip-changelog)$" - use_regex: true - message: >- - Add one release label: feature, change, bug, dependencies, or skip-changelog. Add major as an optional - version modifier. - checks: - if: github.event_name == 'pull_request' + name: ${{ matrix.check }} runs-on: ubuntu-latest + timeout-minutes: 15 strategy: fail-fast: false matrix: check: + # ESLint waits for typescript-eslint to support the installed TypeScript 7. # - eslint - prettier - typescript @@ -59,6 +28,9 @@ jobs: - build steps: - uses: actions/checkout@v7 + with: + ref: ${{ inputs.ref }} + persist-credentials: false - uses: oven-sh/setup-bun@v2 with: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f3c18421..1632685a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,19 +41,48 @@ If you believe you have a better approach, feel free to submit an Issue. ### Pull Requests and Release Notes -Submit changes through a pull request targeting `dev`. Use a specific, release-note-friendly title in the form -`Area: Description`, for example `Templates: Fix commit status badge rendering`. +Submit changes through a pull request targeting `dev`, or stacked on another pull request; checks run for both. A merged +pull request lands in the release draft as `* ([#<number>](<url>))`, under the category of its label. The draft +is written for the people who install the theme, so the title and the label decide what they read. -Apply exactly one primary release label: +#### Titles -- `feature` for new user-facing capabilities or themes -- `change` for intentional style, template, or compatibility improvements -- `bug` for regressions and incorrect rendering -- `dependencies` for dependency and build-tool updates -- `skip-changelog` for internal changes that should not appear in release notes +- Use the strict format `Area: Description`, with a past-tense description of what changed for the reader: `Introduced`, + `Changed`, `Fixed`, `Removed`. +- Describe the effect, not the implementation: `Branches: Fixed the pull request column on phones`, not + `Branches: Changed branch.css`. +- The draft sorts by the exact area, so spell an area exactly as listed below. -Add `major` when the change requires a major version bump. It modifies version resolution but does not create a separate -release-notes section. +Areas: `Actions`, `Auth`, `Branches`, `Code`, `Commits`, `Dashboard`, `Editor`, `Explore`, `Forks`, `Forms`, `Insights`, +`Issues`, `Labels`, `Milestones`, `Navbar`, `Notifications`, `Organizations`, `Packages`, `Profile`, `Projects`, +`Pull requests`, `Releases`, `Repository`, `Settings`, `Teams`, `Themes`. + +Reuse an existing area whenever one fits; add a new area only for a page people recognise by that name, and add it to +this list in the same pull request. Never use file, component or style names as an area. + +#### Labels + +| Label | Use for | Draft section | +| ---------------- | ------------------------------------------------- | ------------- | +| `feature` | a page, control or theme that is new to users | What’s new | +| `change` | a changed look, template or compatibility | Enhancements | +| `bug` | a fix for a bug that shipped in a release | Fixes | +| `dependencies` | a dependency or build-tool update | Dependencies | +| `skip-changelog` | anything a reader of the release would not notice | not listed | + +Apply exactly one of them; the pull request metadata check enforces it with the title format. A fix for a bug that only +existed on `dev` is `skip-changelog`. Add `major` when admins must act on upgrade, for example a new minimum Forgejo +version; it raises the major version and does not add a section. `suggestion` marks an idea that has not been decided on +yet. + +#### Release notes and screenshots + +The summary and the compatibility section at the top of the draft come from `.github/release-notes.md` when its front +matter names the version the draft resolves to. Update it in the pull request that needs upgrade steps or warnings, +instead of editing the draft. + +A pull request that changes how a page looks shows it in a Before and after table in its description: the same page, +viewport and state, captured in the dev preview. ## Development Environment