Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenL committed Sep 20, 2024
0 parents commit 4094256
Show file tree
Hide file tree
Showing 5 changed files with 212 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
68 changes: 68 additions & 0 deletions .github/workflows/labels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Labels
on:
push:
branches:
- deploy
permissions:
issues: write
jobs:
update-labels:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Remove existing labels
uses: actions/github-script@v7
with:
script: |
const {owner, repo} = context.repo;
while (true) {
const labels = (await github.request("GET /repos/{owner}/{repo}/labels", {
owner,
repo,
headers: {
"X-GitHub-Api-Version": "2022-11-28"
}
})).data;
if (!Array.isArray(labels)) {
throw Error("Expected an array");
}
if (labels.length === 0) {
break;
}
for (const label of labels) {
const name = label.name;
console.log(`Deleting label: ${name}`);
await github.request("DELETE /repos/{owner}/{repo}/labels/{name}", {
owner,
repo,
name,
headers: {
"X-GitHub-Api-Version": "2022-11-28"
}
});
}
}
- name: Create new labels
uses: actions/github-script@v7
with:
script: |
const {owner, repo} = context.repo;
const {colors, labels} = require("./labels.json");
for (const label of labels) {
const {description, name} = label;
const color = label.color || Object.entries(colors).find(c => new RegExp(c[0]).test(name))[1];
console.log(`Creating label: ${name}; color = ${color}; description = ${description}`);
await github.request("POST /repos/{owner}/{repo}/labels", {
owner,
repo,
name,
description,
color,
headers: {
"X-GitHub-Api-Version": "2022-11-28"
}
});
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 webview

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# GitHub Labels

This repository has a set of issue labels that can be reused by cloning them to other repositories using the GitHub CLI tool (`gh label clone`).

The labels for this repository are defined in source code and are automatically created via GitHub Actions when pushing the deployment branch.
110 changes: 110 additions & 0 deletions labels.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"colors": {
"^scope:": "fef2c0",
"^status:": "1d76db",
"^type:": "b60205",
"^ui:": "bfd4f2",
"^browser:": "c2e0c6",
"^need:": "fbca04",
"^os:": "5319e7",
"^priority:": "e99695"
},
"labels": [
{
"description": "Involves changes to API or in-source API documentation",
"name": "scope: api"
},
{
"description": "Involves build system/scripts",
"name": "scope: build"
},
{
"description": "Involves CI/CD",
"name": "scope: ci"
},
{
"description": "Involves documentation such as the readme file and examples",
"name": "scope: documentation"
},
{
"description": "Issue or pull request is blocked by another issue or PR",
"name": "status: blocked"
},
{
"description": "Issue is being worked on",
"name": "status: in progress"
},
{
"description": "Issue or pull request was rejected",
"name": "status: rejected"
},
{
"description": "Issue is a bug report",
"name": "type: bug"
},
{
"description": "Issue is a feature request",
"name": "type: feature request"
},
{
"description": "Pull request is a feature",
"name": "type: feature"
},
{
"description": "Pull request is a fix",
"name": "type: fix"
},
{
"description": "Pull request is an improvement of an existing feature",
"name": "type: improvement"
},
{
"description": "Pull request refactors code",
"name": "type: refactor"
},
{
"description": "Help from the community is requested",
"name": "need: help"
},
{
"description": "Further information is requested",
"name": "need: info"
},
{
"description": "Opinions from the community are requested",
"name": "need: opinion"
},
{
"description": "Tests are requested",
"name": "need: test"
},
{
"description": "Involves Linux operating systems",
"name": "os: linux"
},
{
"description": "Involves macOS operating systems",
"name": "os: macos"
},
{
"description": "Involves Windows operating systems",
"name": "os: windows"
},
{
"description": "May be handled in the distant future when time allows",
"name": "priority: low"
},
{
"description": "Should be handled within a reasonable amount of time",
"name": "priority: medium"
},
{
"description": "Should be handled as soon as possible",
"name": "priority: high"
},
{
"description": "An urgent resolution is needed with the highest priority",
"name": "priority: urgent"
}
]
}

0 comments on commit 4094256

Please sign in to comment.