feat: add issue_templates for creation of icons (#935)

Co-authored-by: Dashboard Icons Bot <homarr-labs@proton.me>
This commit is contained in:
Meier Lukas
2025-02-15 15:59:12 +01:00
committed by GitHub
parent 02aaf9bb7f
commit d1e008be5f
56 changed files with 18527 additions and 44 deletions

View File

@@ -0,0 +1,73 @@
name: "Add light & dark icon"
description: Use this template to add a new icon to the project. Monochrome icons need both light and dark versions.
title: "feat(icons): add [NAME]"
labels: ["monochrome-icon"]
body:
- type: markdown
attributes:
value: |
Hello and thank you for contributing to the project! Please fill out the following information to add a new icon to the project.
Once you've submitted the issue, sombody from the team will review it, before adding a label which automatically creates a pull request with the other filetypes.
If you submit a PNG icon, please note, that the SVG can not be generated from it.
- type: input
attributes:
label: Icon name
description: The name has to be unique and should be kebab-case.
placeholder: e.g. "icon-name"
- type: textarea
attributes:
label: Paste light mode icon
description: |
Please paste the icon here. It will automatically upload it to github. This icon should be visible on a light background.
- type: textarea
attributes:
label: Paste dark mode icon
description: |
Please paste the icon here. It will automatically upload it to github. This icon should be visible on a dark background.
- type: dropdown
attributes:
label: Icon type
options:
- SVG
- PNG
- type: dropdown
attributes:
label: Categories
multiple: true
options:
- Animal
- Cloud
- Communication
- Design
- Development
- E-Commerce
- Education
- File
- Finance
- Food
- Gaming
- Hardware
- Health
- Location
- Logistics
- Media
- Music
- Nature
- News
- Organization
- Search
- Security
- SocialMedia
- Streaming
- Travel
- Video
- type: input
attributes:
label: Aliases
description: A comma separated list of aliases
placeholder: e.g. "icon-alias, icon-alias-2"
- type: textarea
attributes:
label: Additional information
description: |
Add additional informations like a link to the application.

View File

@@ -0,0 +1,68 @@
name: "Add normal icon"
description: Use this template to add a new icon to the project. Normal icons work for both light and dark themes.
title: "feat(icons): add [NAME]"
labels: ["normal-icon"]
body:
- type: markdown
attributes:
value: |
Hello and thank you for contributing to the project! Please fill out the following information to add a new icon to the project.
Once you've submitted the issue, sombody from the team will review it, before adding a label which automatically creates a pull request with the other filetypes.
If you submit a PNG icon, please note, that the SVG can not be generated from it.
- type: input
attributes:
label: Icon name
description: The name has to be unique and should be kebab-case.
placeholder: e.g. "icon-name"
- type: textarea
attributes:
label: Paste icon
description: |
Please paste the icon here. It will automatically upload it to github.
- type: dropdown
attributes:
label: Icon type
options:
- SVG
- PNG
- type: dropdown
attributes:
label: Categories
multiple: true
options:
- Animal
- Cloud
- Communication
- Design
- Development
- E-Commerce
- Education
- File
- Finance
- Food
- Gaming
- Hardware
- Health
- Location
- Logistics
- Media
- Music
- Nature
- News
- Organization
- Search
- Security
- SocialMedia
- Streaming
- Travel
- Video
- type: input
attributes:
label: Aliases
description: A comma separated list of aliases
placeholder: e.g. "icon-alias, icon-alias-2"
- type: textarea
attributes:
label: Additional information
description: |
Add additional informations like a link to the application.

View File

@@ -0,0 +1,35 @@
name: "Update light & dark icon"
description: Use this template to update an existing icon. Monochrome icons need both light and dark versions.
title: "feat(icons): update [NAME]"
labels: ["monochrome-icon"]
body:
- type: markdown
attributes:
value: |
Hello and thank you for contributing to the project! Please fill out the following informations to update an existing icon in the project.
- type: input
attributes:
label: Icon name
description: The name has to be unique and should be kebab-case.
placeholder: e.g. "icon-name"
- type: textarea
attributes:
label: Paste light mode icon
description: |
Please paste the icon here. It will automatically upload it to github. This icon should be visible on a light background.
- type: textarea
attributes:
label: Paste dark mode icon
description: |
Please paste the icon here. It will automatically upload it to github. This icon should be visible on a dark background.
- type: dropdown
attributes:
label: Icon type
options:
- SVG
- PNG
- type: textarea
attributes:
label: Additional information
description: |
Add additional informations like, the reason for the update, or what has been changed.

View File

@@ -0,0 +1,30 @@
name: "Update normal icon"
description: Use this template to update an existing icon. Normal icons work for both light and dark themes.
title: "feat(icons): update [NAME]"
labels: ["normal-icon"]
body:
- type: markdown
attributes:
value: |
Hello and thank you for contributing to the project! Please fill out the following informations to update an existing icon in the project.
- type: input
attributes:
label: Icon name
description: The name has to match the existing icon name.
placeholder: e.g. "icon-name"
- type: textarea
attributes:
label: Paste icon
description: |
Please paste the icon here. It will automatically upload it to github.
- type: dropdown
attributes:
label: Icon type
options:
- SVG
- PNG
- type: textarea
attributes:
label: Additional information
description: |
Add additional informations like, the reason for the update, or what has been changed.

View File

@@ -1,8 +1,6 @@
name: Compress Icons
on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
jobs:

View File

@@ -0,0 +1,69 @@
name: "[Icon] Icon addition approved"
on:
issues:
types: [labeled]
jobs:
add-icon:
runs-on: ubuntu-latest
# This condition ensures the job only runs when the 'approved' label is added and the issue title starts with 'feat(icons): add '
if: |
contains(github.event.issue.labels.*.name, 'approved') &&
startsWith(github.event.issue.title, 'feat(icons): add ')
env:
ICON_TYPE: ${{ contains(github.event.issue.labels.*.name, 'normal-icon') && 'normal' || 'monochrome' }}
steps:
- name: Obtain token
id: obtainToken
uses: tibdex/github-app-token@v2
with:
private_key: ${{ secrets.DASHBOARD_ICONS_MANAGER_APP_PRIVATE_KEY }}
app_id: ${{ vars.DASHBOARD_ICONS_MANAGER_APP_ID }}
- name: Checkout repository
uses: actions/checkout@v4
env:
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Dependencies
run: |
pip install cairosvg pillow requests
- name: Parse issue form
id: parse_issue_form
run: echo "ISSUE_FORM=$(python scripts/parse_issue_form.py)" >> "$GITHUB_OUTPUT"
env:
INPUT_ISSUE_BODY: ${{ github.event.issue.body }}
- name: Create metadata file
run: python scripts/generate_metadata_file.py ${{ env.ICON_TYPE }} addition
env:
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
INPUT_ISSUE_AUTHOR_ID: ${{ github.event.issue.user.id }}
INPUT_ISSUE_AUTHOR_LOGIN: ${{ github.event.issue.user.login }}
- name: Generate icons
run: python scripts/generate_icons.py ${{ env.ICON_TYPE }} addition
env:
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
- name: Extract icon name
id: extract_icon_name
run: echo "ICON_NAME=$(python scripts/print_icon_name.py ${{ env.ICON_TYPE }} addition)" >> "$GITHUB_OUTPUT"
env:
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
- name: Commit changes
run: |
git config --global user.email "193821040+dashboard-icons-manager[bot]@users.noreply.github.com"
git config --global user.name "Dashboard Icons Manager"
git add .
git commit -m "feat(icons): add ${{ steps.extract_icon_name.outputs.ICON_NAME }}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.obtainToken.outputs.token }}
branch: icons/add-${{steps.extract_icon_name.outputs.ICON_NAME}}
base: main
title: "feat(icons): add ${{steps.extract_icon_name.outputs.ICON_NAME}}"
delete-branch: true
body: |
This PR adds the icon ${{steps.extract_icon_name.outputs.ICON_NAME}} added in #${{github.event.issue.number}} to the project.

View File

@@ -0,0 +1,69 @@
name: "[Icon] Icon update approved"
on:
issues:
types: [labeled]
jobs:
update-icon:
runs-on: ubuntu-latest
# This condition ensures the job only runs when the 'approved' label is updated and the issue title starts with 'feat(icons): update '
if: |
contains(github.event.issue.labels.*.name, 'approved') &&
startsWith(github.event.issue.title, 'feat(icons): update ')
env:
ICON_TYPE: ${{ contains(github.event.issue.labels.*.name, 'normal-icon') && 'normal' || 'monochrome' }}
steps:
- name: Obtain token
id: obtainToken
uses: tibdex/github-app-token@v2
with:
private_key: ${{ secrets.DASHBOARD_ICONS_MANAGER_APP_PRIVATE_KEY }}
app_id: ${{ vars.DASHBOARD_ICONS_MANAGER_APP_ID }}
- name: Checkout repository
uses: actions/checkout@v4
env:
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Dependencies
run: |
pip install cairosvg pillow requests
- name: Parse issue form
id: parse_issue_form
run: echo "ISSUE_FORM=$(python scripts/parse_issue_form.py)" >> "$GITHUB_OUTPUT"
env:
INPUT_ISSUE_BODY: ${{ github.event.issue.body }}
- name: Update metadata file
run: python scripts/generate_metadata_file.py ${{ env.ICON_TYPE }} update
env:
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
INPUT_ISSUE_AUTHOR_ID: ${{ github.event.issue.user.id }}
INPUT_ISSUE_AUTHOR_LOGIN: ${{ github.event.issue.user.login }}
- name: Generate icons
run: python scripts/generate_icons.py ${{ env.ICON_TYPE }} update
env:
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
- name: Extract icon name
id: extract_icon_name
run: echo "ICON_NAME=$(python scripts/print_icon_name.py ${{ env.ICON_TYPE }} update)" >> "$GITHUB_OUTPUT"
env:
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
- name: Commit changes
run: |
git config --global user.email "193821040+dashboard-icons-manager[bot]@users.noreply.github.com"
git config --global user.name "Dashboard Icons Manager"
git add .
git commit -m "feat(icons): update ${{ steps.extract_icon_name.outputs.ICON_NAME }}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.obtainToken.outputs.token }}
branch: icons/update-${{steps.extract_icon_name.outputs.ICON_NAME}}
base: main
title: "feat(icons): update ${{steps.extract_icon_name.outputs.ICON_NAME}}"
delete-branch: true
body: |
This PR updates the icon ${{steps.extract_icon_name.outputs.ICON_NAME}} like requested in #${{github.event.issue.number}} to the project.