|
| 1 | +# # |
| 2 | +# @type github workflow |
| 3 | +# @desc manually activated workflow to remove issue labels |
| 4 | +# @author Aetherinox |
| 5 | +# @url https://github.com/Aetherinox |
| 6 | +# |
| 7 | +# This Github action must be activated manually. This workflow script will do the |
| 8 | +# following: |
| 9 | +# |
| 10 | +# - Remove all existing labels in repository |
| 11 | +# # |
| 12 | + |
| 13 | +name: "🎫 Labels › Remove" |
| 14 | +run-name: "🎫 Labels › Remove" |
| 15 | + |
| 16 | +# # |
| 17 | +# triggers |
| 18 | +# # |
| 19 | + |
| 20 | +on: |
| 21 | + workflow_dispatch: |
| 22 | + |
| 23 | +# # |
| 24 | +# environment variables |
| 25 | +# # |
| 26 | + |
| 27 | +env: |
| 28 | + BOT_NAME_1: EuropaServ |
| 29 | + BOT_NAME_DEPENDABOT: dependabot[bot] |
| 30 | + LABELS_JSON: | |
| 31 | + [ |
| 32 | + { "name": "AC › Changes Made", "color": "8F1784", "description": "Requested changes have been made and are pending a re-scan" }, |
| 33 | + { "name": "AC › Changes Required", "color": "8F1784", "description": "Requires changes to be made to the package before being accepted" }, |
| 34 | + { "name": "AC › Failed", "color": "a61f2d", "description": "Autocheck failed to run through a complete cycle, requires investigation" }, |
| 35 | + { "name": "AC › Needs Rebase", "color": "8F1784", "description": "Due to the permissions on the requesting repo, this pull request must be rebased by the author" }, |
| 36 | + { "name": "AC › Passed", "color": "146b4a", "description": "Ready to be reviewed" }, |
| 37 | + { "name": "AC › Review Required", "color": "8F1784", "description": "PR needs to be reviewed by another person, after the requested changes have been made" }, |
| 38 | + { "name": "AC › Security Warning", "color": "761620", "description": "Does not conform to developer policies, or includes potentially dangerous code" }, |
| 39 | + { "name": "AC › Skipped Scan", "color": "8F1784", "description": "Author has skipped code scan" }, |
| 40 | + { "name": "Status 𐄂 Duplicate", "color": "75536b", "description": "Issue or pull request already exists" }, |
| 41 | + { "name": "Status 𐄂 Accepted", "color": "2e7539", "description": "This pull request has been accepted" }, |
| 42 | + { "name": "Status 𐄂 Autoclosed", "color": "3E0915", "description": "Originally stale and was autoclosed for no activity" }, |
| 43 | + { "name": "Status 𐄂 Denied", "color": "ba4058", "description": "Pull request has been denied" }, |
| 44 | + { "name": "Status 𐄂 Locked", "color": "550F45", "description": "Automatically locked by AdminServ for a prolonged period of inactivity" }, |
| 45 | + { "name": "Status 𐄂 Need Info", "color": "2E3C4C", "description": "Not enough information to resolve" }, |
| 46 | + { "name": "Status 𐄂 No Action", "color": "030406", "description": "Closed without any action being taken" }, |
| 47 | + { "name": "Status 𐄂 Pending", "color": "984b12", "description": "Pending pull request" }, |
| 48 | + { "name": "Status 𐄂 Released", "color": "1b6626", "description": "Issues or PR has been implemented and is now live" }, |
| 49 | + { "name": "Status 𐄂 Reopened", "color": "8a6f14", "description": "A previously closed PR which has been re-opened" }, |
| 50 | + { "name": "Status 𐄂 Review", "color": "9e1451", "description": "Currently pending review" }, |
| 51 | + { "name": "Status 𐄂 Stale", "color": "928282", "description": "Has not had any activity in over 30 days" }, |
| 52 | + { "name": "Type ◦ Bug", "color": "9a2c2c", "description": "Something isn't working" }, |
| 53 | + { "name": "Type ◦ Dependency", "color": "243759", "description": "Item is associated to dependency" }, |
| 54 | + { "name": "Type ◦ Docs", "color": "0e588d", "description": "Improvements or modifications to docs" }, |
| 55 | + { "name": "Type ◦ Feature", "color": "3c4e93", "description": "Feature request" }, |
| 56 | + { "name": "Type ◦ Git Action", "color": "030406", "description": "GitHub Action / workflow" }, |
| 57 | + { "name": "Type ◦ Pull Request", "color": "8F1784", "description": "Normal pull request" }, |
| 58 | + { "name": "Type ◦ Roadmap", "color": "8F1784", "description": "Feature or bug currently planned for implementation" }, |
| 59 | + { "name": "Type ◦ Internal", "color": "A51994", "description": "Assigned items are for internal developer use" }, |
| 60 | + { "name": "Build ◦ Desktop", "color": "c7ca4a", "description": "Specific to desktop" }, |
| 61 | + { "name": "Build ◦ Linux", "color": "c7ca4a", "description": "Specific to Linux" }, |
| 62 | + { "name": "Build ◦ MacOS", "color": "c7ca4a", "description": "Specific to MacOS" }, |
| 63 | + { "name": "Build ◦ Mobile", "color": "c7ca4a", "description": "Specific to mobile" }, |
| 64 | + { "name": "Build ◦ Web", "color": "c7ca4a", "description": "Specific to web" }, |
| 65 | + { "name": "Build ◦ Windows", "color": "c7ca4a", "description": "Specific to Windows" }, |
| 66 | + { "name": "› API", "color": "F99B50", "description": "Plugin API, CLI, browser JS API" }, |
| 67 | + { "name": "› Auto-type", "color": "9141E0", "description": "Auto-type functionality in desktop apps" }, |
| 68 | + { "name": "› Browser", "color": "9141E0", "description": "Browser plugins and passing data to <=> from app" }, |
| 69 | + { "name": "› Customization", "color": "E3F0FC", "description": "Customizations: plugins, themes, configs" }, |
| 70 | + { "name": "› Design", "color": "FA70DE", "description": "Design related queries" }, |
| 71 | + { "name": "› Dist", "color": "FA70DE", "description": "Installers and other forms of software distribution" }, |
| 72 | + { "name": "› Enterprise", "color": "11447a", "description": "Issues about collaboration, administration, and so on" }, |
| 73 | + { "name": "› Hardware", "color": "5a7503", "description": "YubiKey, other tokens, biometrics" }, |
| 74 | + { "name": "› Import/Export", "color": "F5FFCC", "description": "Import from and export to different file formats" }, |
| 75 | + { "name": "› Improvement", "color": "185c98", "description": "Enhance an existing feature" }, |
| 76 | + { "name": "› Performance", "color": "006b75", "description": "Web and desktop performance issues" }, |
| 77 | + { "name": "› Plugin Request", "color": "FCE9CA", "description": "Requested changes should be implemented as a plugin" }, |
| 78 | + { "name": "› Security", "color": "F75D39", "description": "Security issues" }, |
| 79 | + { "name": "› Self-Hosting", "color": "fad8c7", "description": "Self-hosting installations and configs" }, |
| 80 | + { "name": "› Storage", "color": "5319e7", "description": "Storage providers: Dropbox, Google, WebDAV, etc." }, |
| 81 | + { "name": "› Updater", "color": "1BADDE", "description": "Auto-updater issues" }, |
| 82 | + { "name": "› UX", "color": "1BADDE", "description": "UX and usability" }, |
| 83 | + { "name": "› Website", "color": "fef2c0", "description": "Website related issues" }, |
| 84 | + { "name": "⚠ Urgent", "color": "a8740e", "description": "Requires urgent attention" }, |
| 85 | + { "name": "⚠ Announcement", "color": "DB4712", "description": "Announcements" }, |
| 86 | + { "name": "📰 Progress Report", "color": "392297", "description": "Development updates" }, |
| 87 | + { "name": "📦 Release", "color": "277542", "description": "Release announcements" }, |
| 88 | + { "name": "✔️ Poll", "color": "972255", "description": "Community polls" }, |
| 89 | + { "name": "❔ Question", "color": "FFFFFF", "description": "All questions" } |
| 90 | + ] |
| 91 | +
|
| 92 | +# # |
| 93 | +# jobs |
| 94 | +# # |
| 95 | + |
| 96 | +jobs: |
| 97 | + |
| 98 | + # # |
| 99 | + # Job › Remove Labels |
| 100 | + # |
| 101 | + # This job removes all existing labels |
| 102 | + # # |
| 103 | + |
| 104 | + issues-labels-remove: |
| 105 | + name: >- |
| 106 | + 🎫 Labels › Remove |
| 107 | + runs-on: ubuntu-latest |
| 108 | + permissions: |
| 109 | + contents: 'read' |
| 110 | + id-token: 'write' |
| 111 | + issues: 'write' |
| 112 | + steps: |
| 113 | + |
| 114 | + # # |
| 115 | + # [ Delete Labels ] Start |
| 116 | + # # |
| 117 | + |
| 118 | + - name: >- |
| 119 | + ✅ Start |
| 120 | + id: task_label_remove_start |
| 121 | + run: | |
| 122 | + echo "Starting workflow" |
| 123 | +
|
| 124 | + # # |
| 125 | + # [ Delete Labels ] Checkout |
| 126 | + # # |
| 127 | + |
| 128 | + - name: >- |
| 129 | + ☑️ Checkout |
| 130 | + id: task_label_remove_checkout |
| 131 | + uses: actions/checkout@v4 |
| 132 | + with: |
| 133 | + fetch-depth: 0 |
| 134 | +
|
| 135 | + # # |
| 136 | + # [ Delete Labels ] Start |
| 137 | + # # |
| 138 | + |
| 139 | + - name: >- |
| 140 | + 🏷️ Delete Existing Labels |
| 141 | + id: task_label_remove_run |
| 142 | + uses: actions/github-script@v7 |
| 143 | + with: |
| 144 | + github-token: ${{ secrets.ADMINSERV_TOKEN_CL }} |
| 145 | + script: | |
| 146 | + const labels = JSON.parse( process.env.LABELS_JSON ); |
| 147 | + for ( const label of labels ) |
| 148 | + { |
| 149 | + try |
| 150 | + { |
| 151 | + await github.rest.issues.deleteLabel( |
| 152 | + { |
| 153 | + owner: context.repo.owner, |
| 154 | + repo: context.repo.repo, |
| 155 | + name: label.name, |
| 156 | + }); |
| 157 | + } |
| 158 | + catch ( err ) |
| 159 | + { |
| 160 | + console.error("Error: " + err); |
| 161 | + } |
| 162 | + } |
0 commit comments