Skip to content

Commit

Permalink
ci: update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Aetherinox committed Oct 25, 2024
1 parent 624f53e commit c8c95a9
Show file tree
Hide file tree
Showing 2 changed files with 212 additions and 15 deletions.
44 changes: 29 additions & 15 deletions .github/workflows/issues-stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ env:
LABEL_INTERNAL: "Type ◦ Internal"
LABEL_URGENT: "⚠ Urgent"

BOT_NAME_1: AdminServ
BOT_NAME_2: AdminServX
BOT_NAME_3: EuropaServ
BOT_NAME_1: EuropaServ
BOT_NAME_DEPENDABOT: dependabot[bot]
LABELS_JSON: |
[
Expand Down Expand Up @@ -603,22 +601,20 @@ jobs:
uses: actions/stale@v9
id: task_issues_stale_run
with:
repo-token: ${{ secrets.ADMINSERV_TOKEN }}
repo-token: ${{ secrets.ADMINSERV_TOKEN_CL }}
stale-issue-message: |
⚠️ It looks like there hasn't been any recent updates on this
issue. If you created this issue and no longer consider it
⚠️ It looks like there hasn't been any recent updates on this issue. If you created this issue and no longer consider it
open, then please login to github and close the issue.
If there is no further activity on this issue, it will be
automatically closed in the next few days.
If there is no further activity on this issue, it will be automatically closed in the next week.
---
<sub>I am a bot reaching out to you with an automated response.</sub>
stale-issue-label: 'Status 𐄂 Stale'
close-issue-label: 'Status 𐄂 Autoclosed'
exempt-issue-labels: 'feature,Type ◦ Feature,bug,Type ◦ Bug'
days-before-stale: 30
exempt-issue-labels: 'Status 𐄂 Accepted,Status 𐄂 Review,Status 𐄂 Pending,Type ◦ Bug,Type ◦ Dependency,Type ◦ Docs,Type ◦ Feature,Type ◦ Git Action,Type ◦ Pull Request,Type ◦ Roadmap'
days-before-stale: 14
days-before-close: 7
days-before-pr-stale: -1
days-before-pr-close: -1
Expand All @@ -644,10 +640,28 @@ jobs:
uses: dessant/lock-threads@v5
id: task_issues_lock_run
with:
add-pr-labels: 'Status 𐄂 Locked'
github-token: ${{ secrets.ADMINSERV_TOKEN_CL }}
exclude-any-issue-labels: 'AC › Review Required,Status 𐄂 Accepted,Status 𐄂 Review,Status 𐄂 Pending,Type ◦ Bug,Type ◦ Dependency,Type ◦ Docs,Type ◦ Feature,Type ◦ Git Action,Type ◦ Roadmap,Type ◦ Internal'
add-issue-labels: 'Status 𐄂 Locked'
github-token: ${{ secrets.ADMINSERV_TOKEN }}
issue-inactive-days: '180'
issue-lock-reason: 'resolved'
issue-inactive-days: '60'
issue-lock-reason: 'issue inactive for 60 days'
issue-comment: >
⚠️ This **issue** has been automatically locked since there has not been any recent activity after it was closed.
Please open a new issue for related bugs.
---
<sub>I am a bot reaching out to you with an automated response.</sub>
exclude-any-pr-labels: 'AC › Review Required,Status 𐄂 Accepted,Status 𐄂 Review,Status 𐄂 Pending,Type ◦ Bug,Type ◦ Dependency,Type ◦ Docs,Type ◦ Feature,Type ◦ Git Action,Type ◦ Roadmap,Type ◦ Internal'
add-pr-labels: 'Status 𐄂 Locked'
pr-inactive-days: '365'
pr-lock-reason: 'resolved'
pr-lock-reason: 'pr inactive for 365 days'
pr-comment: >
⚠️ This **pull request** has been automatically locked since there has not been any recent activity after it was closed.
Please open a new issue for related bugs.
---
<sub>I am a bot reaching out to you with an automated response.</sub>
183 changes: 183 additions & 0 deletions .github/workflows/labels-clean..yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
# #
# @type github workflow
# @desc manually activated workflow to remove issue labels
# @author Aetherinox
# @url https://github.com/Aetherinox
#
# This Github action must be activated manually. This workflow script will do the
# following:
#
# - Remove all existing labels in repository
# #

name: "🎫 Labels › Remove"
run-name: "🎫 Labels › Remove"

# #
# triggers
# #

on:
workflow_dispatch:

# #
# environment variables
# #

env:
BOT_NAME_1: 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 › Remove Labels
#
# This job removes all existing labels
# #

issues-labels-remove:
name: >-
🎫 Labels › Remove
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
issues: 'write'
steps:

# #
# [ Delete Labels ] Start
# #

- name: >-
✅ Start
id: task_label_remove_start
run: |
echo "Starting workflow"
# #
# [ Delete Labels ] Checkout
# #

- name: >-
☑️ Checkout
id: task_label_remove_checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# #
# [ Delete Labels ] Start
# #

- name: >-
🏷️ Delete Existing Labels
id: task_label_remove_run
uses: actions/github-script@v7
with:
github-token: ${{ secrets.ADMINSERV_TOKEN_CL }}
script: |
const targetOwner = context.repo.owner;
const targetRepo = context.repo.repo;
// Fetch labels from the source repository
const response = await github.rest.issues.listLabelsForRepo({
owner: targetOwner,
repo: targetRepo,
});
console.log("Labels fetched: ", response.data);
const labels = response.data;
if (labels.length === 0) {
console.log("No labels found in the source repository.");
}
// Fetch all labels from the target repository and delete them
const existingLabels = await github.rest.issues.listLabelsForRepo({
owner: targetOwner,
repo: targetRepo,
});
// const labels = JSON.parse( process.env.LABELS_JSON );
for ( const label of labels )
{
try
{
await github.rest.issues.deleteLabel(
{
owner: context.repo.owner,
repo: context.repo.repo,
name: label.name,
});
}
catch ( err )
{
console.error("Error: " + err);
}
}

0 comments on commit c8c95a9

Please sign in to comment.