Skip to content

🎫 Labels β€Ί Create #1

🎫 Labels β€Ί Create

🎫 Labels β€Ί Create #1

Workflow file for this run

# #
# @type github workflow
# @desc manually activated workflow to create issue labels
# @author Aetherinox
# @url https://github.com/Aetherinox
#
# This Github action must be activated manually. This workflow script will do the
# following:
#
# - Scan issues / pull requests and make sure they have properly assigned labels:
# - `Bug`
# - `Feature`
# - `Urgent`
# - `Roadmap`
#
# - Workflow script will then scan each pr or issue and mark them as `Stale`
# if they haven't had any replies in 30 days.
#
# - Workflow will `autoclose` pr or issues which haven't had action in `365 days`.
# #
name: "🎫 Labels β€Ί Create"
run-name: "🎫 Labels β€Ί Create"
# #
# triggers
# #
on:
workflow_dispatch:
# #
# environment variables
# #
env:
BOT_NAME_1: AdminServ
BOT_NAME_2: AdminServX
BOT_NAME_3: EuropaServ
BOT_NAME_DEPENDABOT: dependabot[bot]
LABELS_JSON: |
[
{ "name": "AC β€Ί Changes Made", "color": "8F1784", "description": "Requested changes have been made and are pending a re-scan" },
{ "name": "AC β€Ί Changes Required", "color": "8F1784", "description": "Requires changes to be made to the package before being accepted" },
{ "name": "AC β€Ί Failed", "color": "a61f2d", "description": "Autocheck failed to run through a complete cycle, requires investigation" },
{ "name": "AC β€Ί Needs Rebase", "color": "8F1784", "description": "Due to the permissions on the requesting repo, this pull request must be rebased by the author" },
{ "name": "AC β€Ί Passed", "color": "146b4a", "description": "Ready to be reviewed" },
{ "name": "AC β€Ί Review Required", "color": "8F1784", "description": "PR needs to be reviewed by another person, after the requested changes have been made" },
{ "name": "AC β€Ί Security Warning", "color": "761620", "description": "Does not conform to developer policies, or includes potentially dangerous code" },
{ "name": "AC β€Ί Skipped Scan", "color": "8F1784", "description": "Author has skipped code scan" },
{ "name": "Status 𐄂 Duplicate", "color": "75536b", "description": "Issue or pull request already exists" },
{ "name": "Status 𐄂 Accepted", "color": "2e7539", "description": "This pull request has been accepted" },
{ "name": "Status 𐄂 Autoclosed", "color": "3E0915", "description": "Originally stale and was autoclosed for no activity" },
{ "name": "Status 𐄂 Denied", "color": "ba4058", "description": "Pull request has been denied" },
{ "name": "Status 𐄂 Locked", "color": "550F45", "description": "Automatically locked by AdminServ for a prolonged period of inactivity" },
{ "name": "Status 𐄂 Need Info", "color": "2E3C4C", "description": "Not enough information to resolve" },
{ "name": "Status 𐄂 No Action", "color": "030406", "description": "Closed without any action being taken" },
{ "name": "Status 𐄂 Pending", "color": "984b12", "description": "Pending pull request" },
{ "name": "Status 𐄂 Released", "color": "1b6626", "description": "Issues or PR has been implemented and is now live" },
{ "name": "Status 𐄂 Reopened", "color": "8a6f14", "description": "A previously closed PR which has been re-opened" },
{ "name": "Status 𐄂 Review", "color": "9e1451", "description": "Currently pending review" },
{ "name": "Status 𐄂 Stale", "color": "928282", "description": "Has not had any activity in over 30 days" },
{ "name": "Type β—¦ Bug", "color": "9a2c2c", "description": "Something isn't working" },
{ "name": "Type β—¦ Dependency", "color": "243759", "description": "Item is associated to dependency" },
{ "name": "Type β—¦ Docs", "color": "0e588d", "description": "Improvements or modifications to docs" },
{ "name": "Type β—¦ Feature", "color": "3c4e93", "description": "Feature request" },
{ "name": "Type β—¦ Git Action", "color": "030406", "description": "GitHub Action / workflow" },
{ "name": "Type β—¦ Pull Request", "color": "8F1784", "description": "Normal pull request" },
{ "name": "Type β—¦ Roadmap", "color": "8F1784", "description": "Feature or bug currently planned for implementation" },
{ "name": "Type β—¦ Internal", "color": "A51994", "description": "Assigned items are for internal developer use" },
{ "name": "Build β—¦ Desktop", "color": "c7ca4a", "description": "Specific to desktop" },
{ "name": "Build β—¦ Linux", "color": "c7ca4a", "description": "Specific to Linux" },
{ "name": "Build β—¦ MacOS", "color": "c7ca4a", "description": "Specific to MacOS" },
{ "name": "Build β—¦ Mobile", "color": "c7ca4a", "description": "Specific to mobile" },
{ "name": "Build β—¦ Web", "color": "c7ca4a", "description": "Specific to web" },
{ "name": "Build β—¦ Windows", "color": "c7ca4a", "description": "Specific to Windows" },
{ "name": "β€Ί API", "color": "F99B50", "description": "Plugin API, CLI, browser JS API" },
{ "name": "β€Ί Auto-type", "color": "9141E0", "description": "Auto-type functionality in desktop apps" },
{ "name": "β€Ί Browser", "color": "9141E0", "description": "Browser plugins and passing data to <=> from app" },
{ "name": "β€Ί Customization", "color": "E3F0FC", "description": "Customizations: plugins, themes, configs" },
{ "name": "β€Ί Design", "color": "FA70DE", "description": "Design related queries" },
{ "name": "β€Ί Dist", "color": "FA70DE", "description": "Installers and other forms of software distribution" },
{ "name": "β€Ί Enterprise", "color": "11447a", "description": "Issues about collaboration, administration, and so on" },
{ "name": "β€Ί Hardware", "color": "5a7503", "description": "YubiKey, other tokens, biometrics" },
{ "name": "β€Ί Import/Export", "color": "F5FFCC", "description": "Import from and export to different file formats" },
{ "name": "β€Ί Improvement", "color": "185c98", "description": "Enhance an existing feature" },
{ "name": "β€Ί Performance", "color": "006b75", "description": "Web and desktop performance issues" },
{ "name": "β€Ί Plugin Request", "color": "FCE9CA", "description": "Requested changes should be implemented as a plugin" },
{ "name": "β€Ί Security", "color": "F75D39", "description": "Security issues" },
{ "name": "β€Ί Self-Hosting", "color": "fad8c7", "description": "Self-hosting installations and configs" },
{ "name": "β€Ί Storage", "color": "5319e7", "description": "Storage providers: Dropbox, Google, WebDAV, etc." },
{ "name": "β€Ί Updater", "color": "1BADDE", "description": "Auto-updater issues" },
{ "name": "β€Ί UX", "color": "1BADDE", "description": "UX and usability" },
{ "name": "β€Ί Website", "color": "fef2c0", "description": "Website related issues" },
{ "name": "⚠ Urgent", "color": "a8740e", "description": "Requires urgent attention" },
{ "name": "⚠ Announcement", "color": "DB4712", "description": "Announcements" },
{ "name": "πŸ“° Progress Report", "color": "392297", "description": "Development updates" },
{ "name": "πŸ“¦ Release", "color": "277542", "description": "Release announcements" },
{ "name": "βœ”οΈ Poll", "color": "972255", "description": "Community polls" },
{ "name": "❔ Question", "color": "FFFFFF", "description": "All questions" }
]
# #
# jobs
# #
jobs:
# #
# Job [ Verify / Create Labels ]
#
# This job will ensure you have labels already created in your repo.
# All labels come from the JSON table LABELS_JSON.
# #
issues-labels-create:
name: >-
🎫 Labels β€Ί Create
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
issues: 'write'
steps:
# #
# [ Create Labels ] Start
# #
- name: >-
βœ… Start
id: task_label_create_start
run: |
echo "Assigning labels and assignees"
# #
# [ Create Labels ] Checkout
# #
- name: >-
β˜‘οΈ Checkout
id: task_label_create_checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# #
# [ Create Labels ] Verify Existing Labels
# #
- name: >-
🏷️ Verify Existing Labels
uses: actions/github-script@v7
with:
github-token: ${{ secrets.ADMINSERV_TOKEN_CL }}
script: |
const labels = JSON.parse( process.env.LABELS_JSON );
for ( const label of labels )
{
try
{
await github.rest.issues.createLabel(
{
owner: context.repo.owner,
repo: context.repo.repo,
name: label.name,
description: label.description || '',
color: label.color
});
}
catch ( err )
{
if ( err.status === 422 )
{
console.log( `Label '${label.name}' already exists. Skipping.` );
}
else
{
console.error( `Error creating label '${label.name}': ${err}` );
}
}
}