From 5a1cf7cb93c20b23271210ce8cd6de5bffcc3783 Mon Sep 17 00:00:00 2001 From: Mauro Balades Date: Thu, 15 Aug 2024 19:46:12 +0200 Subject: [PATCH] feat: Add issue template and workflow for creating themes This commit adds an issue template and a workflow for creating themes in the repository. The issue template allows users to submit a theme to be added to the theme library, while the workflow automatically parses the submitted issue and performs necessary checks. --- .github/ISSUE_TEMPLATE/create-theme.yml | 50 +++++++++++++++++++++++++ .github/workflows/create-theme.yml | 31 +++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/create-theme.yml create mode 100644 .github/workflows/create-theme.yml diff --git a/.github/ISSUE_TEMPLATE/create-theme.yml b/.github/ISSUE_TEMPLATE/create-theme.yml new file mode 100644 index 00000000..a5b74f20 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/create-theme.yml @@ -0,0 +1,50 @@ +name: Sumbit a theme +description: Submit a theme to be added to the theme library. +title: "[create-theme]: " +labels: ["new-theme"] +body: + - type: input + id: name + attributes: + label: Name + description: The name of the theme. + placeholder: Theme Name + validations: + required: true + - type: input + id: description + attributes: + label: Description + description: A brief description of the theme. + placeholder: Theme Description + validations: + required: true + - type: input + id: homepage + attributes: + label: Homepage + description: The URL of the theme's homepage or repository. + placeholder: Theme Homepage + validations: + required: true + - type: textarea + id: Theme Styles + attributes: + label: Theme Styles + description: The CSS styles for the theme. + placeholder: | + body { + background-color: white; + color: black; + } + validations: + required: true + - type: markdown + id: readme + attributes: + label: README + description: A markdown display for the theme. This will be displayed in the theme marketplace. + placeholder: | + # Theme Name + A brief description of the theme. + \ No newline at end of file diff --git a/.github/workflows/create-theme.yml b/.github/workflows/create-theme.yml new file mode 100644 index 00000000..f2eb3c3b --- /dev/null +++ b/.github/workflows/create-theme.yml @@ -0,0 +1,31 @@ +on: + issues: + types: [opened] + +jobs: + titlePrefixCheck: + runs-on: ubuntu-latest + steps: + + - name: Parse issue + id: parse + uses: onmax/issue-form-parser@v1.5 + with: + issue_number: ${{ github.event.issue.number }} + + # Examples on how to use the output + - name: Show parsed payload data + run: | + # Using the character `'` to prevent all characters enclosed within + # them from being treated as special characters (e.g. $ or `) + echo '${{ steps.parse.outputs.payload }}' + + # Print the value of the "Name" field + echo '${{ fromJson(steps.parse.outputs.payload)["Name"] }}' + + - if: startsWith(github.event.issue.title, '[create-theme]: ') != 'true' + name: Close Issue + uses: peter-evans/close-issue@v3 + with: + comment: | + # Thank you for your contribution!