From 70c12ca24b3f37de49a590aa6be9353de8219aae Mon Sep 17 00:00:00 2001 From: Tyler Koenig Date: Sat, 20 Jun 2026 12:36:46 -0400 Subject: [PATCH] feat(github): accept issues on GitHub and auto-forward to Gitea GitHub mirror previously redirected issue reporters to Gitea, which requires login. Now GitHub Issues are accepted directly via form templates (bug report + feature request) and a workflow forwards new issues to Gitea with label mapping and provenance header. --- .github/ISSUE_TEMPLATE/bug_report.yml | 46 +++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 7 -- .github/ISSUE_TEMPLATE/feature_request.yml | 20 ++++++ .github/workflows/forward-issues.yml | 77 ++++++++++++++++++++++ 4 files changed, 143 insertions(+), 7 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/workflows/forward-issues.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..76a0e32 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,46 @@ +name: Bug Report +description: Something isn't working as expected +labels: + - bug +body: + - type: checkboxes + id: search + attributes: + label: Before filing + options: + - label: I searched existing issues and didn't find a match + required: true + - type: textarea + id: description + attributes: + label: What happened? + description: Include what you expected to happen instead. + placeholder: | + When I run `uptop`, the TUI crashes after 10 seconds. + I expected it to keep running and display monitor status. + validations: + required: true + - type: textarea + id: reproduction + attributes: + label: Steps to reproduce + placeholder: | + 1. Run `uptop` + 2. Wait ~10 seconds + 3. TUI crashes with panic + validations: + required: true + - type: textarea + id: environment + attributes: + label: Environment & logs + description: Output of `uptop version`, OS, terminal. Paste any errors below. + render: shell + placeholder: | + uptop 0.1.0 (abc1234, 2026-06-17) + OS: Debian 13 + Terminal: Ghostty + + [paste any error output here] + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index c83f8db..3ba13e0 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,8 +1 @@ blank_issues_enabled: false -contact_links: - - name: Report a Bug - url: https://gitea.lerkolabs.com/lerkolabs/uptop/issues/new?template=bug_report.yaml - about: Report bugs on our Gitea instance - - name: Request a Feature - url: https://gitea.lerkolabs.com/lerkolabs/uptop/issues/new?template=feature_request.yaml - about: Suggest features on our Gitea instance diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..31803a4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,20 @@ +name: Feature Request +description: Suggest a new feature or enhancement +labels: + - feature +body: + - type: textarea + id: problem + attributes: + label: Problem + description: What's frustrating or missing? + placeholder: I find myself always needing to ... + validations: + required: true + - type: textarea + id: solution + attributes: + label: Proposed solution + description: How would you like this to work? + validations: + required: false diff --git a/.github/workflows/forward-issues.yml b/.github/workflows/forward-issues.yml new file mode 100644 index 0000000..4ad37d8 --- /dev/null +++ b/.github/workflows/forward-issues.yml @@ -0,0 +1,77 @@ +name: Forward Issues to Gitea + +on: + issues: + types: [opened] + +permissions: + issues: write + +jobs: + forward: + runs-on: ubuntu-latest + steps: + - name: Build issue body + env: + ISSUE_BODY: ${{ github.event.issue.body }} + ISSUE_URL: ${{ github.event.issue.html_url }} + ISSUE_AUTHOR: ${{ github.event.issue.user.login }} + run: | + jq -n \ + --arg url "$ISSUE_URL" \ + --arg author "$ISSUE_AUTHOR" \ + --arg body "$ISSUE_BODY" \ + '">" + " Forwarded from GitHub: " + $url + "\n> Reported by: [@" + $author + "](https://github.com/" + $author + ")\n\n---\n\n" + $body' \ + -r > /tmp/gitea-issue-body.md || exit 1 + + - name: Resolve label IDs + id: labels + env: + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + GH_LABELS: ${{ toJSON(github.event.issue.labels.*.name) }} + run: | + GITEA_LABELS=$(curl -f \ + -H "Authorization: token ${GITEA_TOKEN}" \ + "https://gitea.lerkolabs.com/api/v1/repos/lerkolabs/uptop/labels?limit=50") || exit 1 + + LABEL_IDS=$(echo "$GITEA_LABELS" | jq --argjson gh "$GH_LABELS" ' + [.[] | select( + .name == "github" or + (.name as $n | $gh | index($n) != null) + ) | .id] + ') + + echo "ids=${LABEL_IDS}" >> "$GITHUB_OUTPUT" + + - name: Create Gitea issue + id: create + env: + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + ISSUE_TITLE: ${{ github.event.issue.title }} + LABEL_IDS: ${{ steps.labels.outputs.ids }} + run: | + RESPONSE=$(curl -f -X POST \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "Content-Type: application/json" \ + "https://gitea.lerkolabs.com/api/v1/repos/lerkolabs/uptop/issues" \ + -d "$(jq -n \ + --arg title "$ISSUE_TITLE" \ + --rawfile body /tmp/gitea-issue-body.md \ + --argjson labels "$LABEL_IDS" \ + '{title: $title, body: $body, labels: $labels}' + )") || exit 1 + + GITEA_URL=$(echo "$RESPONSE" | jq -re '.html_url') || exit 1 + GITEA_NUM=$(echo "$RESPONSE" | jq -re '.number') || exit 1 + + echo "url=${GITEA_URL}" >> "$GITHUB_OUTPUT" + echo "number=${GITEA_NUM}" >> "$GITHUB_OUTPUT" + + - name: Comment on GitHub issue + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITEA_URL: ${{ steps.create.outputs.url }} + run: | + gh issue comment "${{ github.event.issue.number }}" \ + --repo "${{ github.repository }}" \ + --body "Thanks for reporting! This issue has been forwarded to our [primary tracker](${GITEA_URL}). Discussion and updates will happen there."