# # # @type github workflow # @desc manually activated workflow to remove issue labels # @author Aetherinox # @url https://github.com/Aetherinox # # @notes This Github action must be activated manually. This workflow script will do the following: # - Remove all existing labels in repository # # @secrets secrets.SELF_TOKEN self github personal access token (fine-grained) # secrets.SELF_TOKEN_CL self github personal access token (classic) # secrets.NPM_TOKEN self npmjs access token # secrets.PYPI_API_TOKEN self Pypi API token (production site) - https://pypi.org/ # secrets.PYPI_API_TEST_TOKEN self Pypi API token (test site) - https://test.pypi.org/ # secrets.SELF_DOCKERHUB_TOKEN self Dockerhub token # secrets.CODECOV_TOKEN codecov upload token for nodejs projects # secrets.MAXMIND_GELITE_TOKEN maxmind API token # secrets.CF_ACCOUNT_ID cloudflare account id # secrets.CF_ACCOUNT_TOKEN cloudflare account token # secrets.ORG_TOKEN org github personal access token (fine-grained) # secrets.ORG_TOKEN_CL org github personal access token (classic) # secrets.ORG_DOCKERHUB_TOKEN org dockerhub secret # secrets.ORG_GITEA_TOKEN org gitea personal access token (classic) with package:write permission # secrets.BOT_GPG_KEY_ASC bot gpg private key (armored) | BEGIN PGP PRIVATE KEY BLOCK # secrets.BOT_GPG_KEY_B64 bot gpg private key (binary) converted to base64 # secrets.BOT_GPG_PASSPHRASE bot gpg private key passphrase # secrets.DISCORD_WEBHOOK_CHAN_GITHUB_RELEASES discord webhook to report release notifications from github to discord # secrets.DISCORD_WEBHOOK_CHAN_GITHUB_WORKFLOWS discord webhook to report workflow notifications from github to discord # secrets.DISCORD_WEBHOOK_CHAN_GITHUB_UPDATES discord webhook to report activity notifications from github to discord # # @local these workflows can be tested locally through the use of `act` # https://github.com/nektos/act # Extract act to folder # Add system env var with path to act.exe # Run the commands: # git pull https://github.com/username/repo # act -W .github/workflows/labels-clean.yml -P ubuntu-latest=catthehacker/ubuntu:full-22.04 # act -W .github/workflows/labels-clean.yml -s TOKEN_CL=XXXXXXXXXX --pull=false # # name: '๐Ÿงน Labels โ€บ Clean' run-name: '๐Ÿงน Labels โ€บ Clean' # # # triggers # # on: workflow_dispatch: # # # environment variables # # env: ASSIGN_USER: Aetherinox BOT_NAME_1: EuropaServ BOT_NAME_2: BinaryServ BOT_NAME_DEPENDABOT: dependabot[bot] BOT_NAME_RENOVATE: renovate[bot] LABELS_JSON: | [ { "name": "bug", "color": "8F1784", "description": "Default github label" }, { "name": "documentation", "color": "8F1784", "description": "Default github label" }, { "name": "duplicate", "color": "8F1784", "description": "Default github label" }, { "name": "enhancement", "color": "8F1784", "description": "Default github label" }, { "name": "good first issue", "color": "8F1784", "description": "Default github label" }, { "name": "help wanted", "color": "8F1784", "description": "Default github label" }, { "name": "invalid", "color": "8F1784", "description": "Default github label" }, { "name": "question", "color": "8F1784", "description": "Default github label" }, { "name": "wontfix", "color": "8F1784", "description": "Default github label" }, { "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 โ€บ Lock Maintenance", "color": "FBCA04", "description": "Sync package-lock.json" }, { "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-clean: name: >- ๐Ÿงน Labels โ€บ Clean # runs-on: ubuntu-latest runs-on: apollo-x64 timeout-minutes: 3 permissions: contents: 'read' id-token: 'write' issues: 'write' steps: # # # Labels โ€บ Clean โ€บ Checkout # # - name: 'โ˜‘๏ธ Checkout' uses: actions/checkout@v4 with: fetch-depth: 0 # # # Labels โ€บ Clean โ€บ Job Information # # - name: >- ๐Ÿ”„ Load Job uses: qoomon/actions--context@v4 id: 'context' # # # Labels โ€บ Clean โ€บ Start # # - name: >- โœ… Start run: | echo "โ€Ž" echo "โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•" echo " Starting Job ${{ steps.context.outputs.job_name }}" echo "โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•" YEAR="$(date +'%Y')" echo "YEAR=${YEAR}" >> $GITHUB_ENV NOW="$(date +'%m-%d-%Y %H:%M:%S')" # 02-25-2025 12:49:48 echo "NOW=${NOW}" >> $GITHUB_ENV NOW_SHORT="$(date +'%m-%d-%Y')" # 02-25-2025 echo "NOW_SHORT=${NOW_SHORT}" >> $GITHUB_ENV NOW_LONG="$(date +'%m-%d-%Y %H:%M')" # 02-25-2025 12:49 echo "NOW_LONG=${NOW_LONG}" >> $GITHUB_ENV NOW_DOCKER="$(date +'%Y%m%d')" # 20250225 echo "NOW_DOCKER=${NOW_DOCKER}" >> $GITHUB_ENV NOW_DOCKER_TS="$(date -u +'%FT%T.%3NZ')" # 2025-02-25T12:50:11.569Z echo "NOW_DOCKER_TS=${NOW_DOCKER_TS}" >> $GITHUB_ENV SHA1="$(git rev-parse HEAD)" # 71fad013cfce9116ec62779e4a7e627fe4c33627 echo "SHA1=${SHA1}" >> $GITHUB_ENV SHA1_GH="$(echo ${GITHUB_SHA})" # 71fad013cfce9116ec62779e4a7e627fe4c33627 echo "SHA1_GH=${SHA1_GH}" >> $GITHUB_ENV PKG_VER_1DIGIT="$(echo ${{ env.IMAGE_VERSION }} | cut -d '.' -f1-1)" # 3.22 > 3 echo "PKG_VER_1DIGIT=${PKG_VER_1DIGIT}" >> $GITHUB_ENV PKG_VER_2DIGIT="$(echo ${{ env.IMAGE_VERSION }} | cut -f2 -d ":" | cut -c1-3)" # 3.22 > 3.2 echo "PKG_VER_2DIGIT=${PKG_VER_2DIGIT}" >> $GITHUB_ENV echo "โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•" echo "โ€Ž" echo "โ€Ž" sudo apt -qq update sudo apt -qq install tree echo "โ€Ž" echo "โ€Ž" echo "โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•" echo "โ€Ž" echo "โ€Ž" echo " Runner .............. ${{ runner.name }}" echo " Workflow ............ ${{ github.workflow }} (#${{ github.workflow_ref }})" echo " Run Number .......... ${{ github.run_number }}" echo " Ref ................. ${{ github.ref }}" echo " Ref Name ............ ${{ github.ref_name }}" echo " Event Name .......... ${{ github.event_name }}" echo " Repo ................ ${{ github.repository }}" echo " Repo Owner .......... ${{ github.repository_owner }}" echo " Run ID .............. https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" echo " Triggered By ........ ${{ github.actor }}" echo " SHA 1 (GITHUB_SHA) .. ${GITHUB_SHA}" echo " SHA 2 (github.sha) .. ${{ github.sha }}" echo " SHA 3 (env.SHA1) .... ${SHA1}" echo " SHA 4 (env.SHA1_GH) . ${SHA1_GH}" echo " Workspace ........... ${{ github.workspace }}" echo " PWD ................. ${PWD}" echo " Job Name ............ ${{ steps.context.outputs.job_name }}" echo " Job ID .............. ${{ steps.context.outputs.job_id }}" echo " Job URL ............. ${{ steps.context.outputs.job_url }}" echo " Run ID .............. ${{ steps.context.outputs.run_id }}" echo " Run Attempt ......... ${{ steps.context.outputs.run_attempt }}" echo " Run Number .......... ${{ steps.context.outputs.run_number }}" echo " Run URL ............. ${{ steps.context.outputs.run_url }}" echo " Run Env ............. ${{ steps.context.outputs.environment }}" echo " Run Env URL ......... ${{ steps.context.outputs.environment_url }}" echo " Run Deployment ...... ${{ steps.context.outputs.deployment_id }}" echo " Run Deployment URL .. ${{ steps.context.outputs.deployment_url }}" echo " Run Deployment ...... ${{ steps.context.outputs.deployment_id }}" echo " Run Runner Name ..... ${{ steps.context.outputs.runner_name }}" echo " Run Runner ID ....... ${{ steps.context.outputs.runner_id }}" echo " Year ................ ${YEAR}" echo " Now ................. ${NOW}" echo " Now (Short) ......... ${NOW_SHORT}" echo " Now (Long) .......... ${NOW_LONG}" echo " Now (Docker) ........ ${NOW_DOCKER}" echo " Now (Docker TS) ..... ${NOW_DOCKER_TS}" echo "โ€Ž" echo "โ€Ž" echo "โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•" echo "โ€Ž" echo "โ€Ž" tree -I node_modules -I .git echo "โ€Ž" echo "โ€Ž" echo "โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•" echo "โ€Ž" echo "โ€Ž" # # # Labels โ€บ Clean โ€บ Delete Existing Labels # # - name: >- ๐Ÿท๏ธ Delete Existing Labels uses: actions/github-script@v7 with: github-token: ${{ secrets.ADMINSERV_TOKEN_CL || github.token }} 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 ); let result = Object.keys(labels).length; 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); } } console.log("[Success]: Added " + result + " labels to repo"); return result # # # Labels โ€บ Clean โ€บ Get Weekly Commits # # - name: >- ๐Ÿ•› Get Weekly Commit List run: | echo 'WEEKLY_COMMITS<> $GITHUB_ENV git log --format="[\`%h\`](${{ github.server_url }}/${{ github.repository }}/commit/%H) %s - %an" --since=7.days >> $GITHUB_ENV echo 'EOF' >> $GITHUB_ENV