mirror of
https://github.com/walkxcode/dashboard-icons.git
synced 2025-10-26 21:19:04 +08:00
feat: add issue_templates for creation of icons (#935)
Co-authored-by: Dashboard Icons Bot <homarr-labs@proton.me>
This commit is contained in:
2
.github/workflows/compress_icons.yml
vendored
2
.github/workflows/compress_icons.yml
vendored
@@ -1,8 +1,6 @@
|
||||
name: Compress Icons
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * 0"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
69
.github/workflows/on_icon_addition_approved.yml
vendored
Normal file
69
.github/workflows/on_icon_addition_approved.yml
vendored
Normal 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.
|
||||
69
.github/workflows/on_icon_update_approved.yml
vendored
Normal file
69
.github/workflows/on_icon_update_approved.yml
vendored
Normal 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.
|
||||
Reference in New Issue
Block a user