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 `*