diff --git a/.github/issue.py b/.github/issue.py index 7c01531..f01505f 100644 --- a/.github/issue.py +++ b/.github/issue.py @@ -14,7 +14,7 @@ def fail(msg): def sanitize_name(name): # Remove any characters that are not letters, numbers, underscores, or periods - return ((((''.join(c for c in name if c.isalnum() or c in ['.'] or c in [' '] or c in ['_'] or c in ['-']))).replace(" ", "_")).replace("-", "_")).replace(".", "_") + return ((((''.join(c for c in name if c.isalnum() or c in ['.'] or c in [' '] or c in ['_'] or c in ['-']))).replace(" ", "_")).replace("-", "_")).replace(".", "_").replace("Clicks", "") index_path = Path(sys.argv[1]) issue_author = sys.argv[2] @@ -106,7 +106,25 @@ def send_webhook(mod_id): } request.urlopen(req, data=json.dumps(data).encode('utf-8')) +try: + mod_directory = index_path / 'MultipleClicks' + version_mod_directory = mod_directory / folderName + version_mod_directory.mkdir(parents=True, exist_ok=False) + clicks_folder = version_mod_directory / "Clicks" + releases_folder = version_mod_directory / "Releases" + clicks_folder.mkdir(parents=True, exist_ok=True) + releases_folder.mkdir(parents=True, exist_ok=True) + + for x in file_list: + listdir = x.split("/") + listdir.pop(len(listdir) - 1) + if "Clicks" in listdir: + archive.extract(x, path=clicks_folder) + if "Releases" in listdir: + archive.extract(x, path=releases_folder) +except Exception as inst: + fail(f'Could not populate click folder {version_mod_directory}: {inst}') potential_issues = [] if potential_issues: diff --git a/.github/workflows/issue.yml b/.github/workflows/issue.yml index aef38aa..05c8fd8 100644 --- a/.github/workflows/issue.yml +++ b/.github/workflows/issue.yml @@ -19,14 +19,12 @@ jobs: - name: Checkout Clicks Repo uses: actions/checkout@v4 with: - token: ${{ secrets.COOP_BOT_PUSH_BIN_TOKEN }} repository: clicksounds/clicks path: clicks - name: Checkout Mod Source uses: actions/checkout@v4 with: - token: ${{ secrets.COOP_BOT_PUSH_BIN_TOKEN }} repository: clicksounds/geode-clicksound path: modsource @@ -91,10 +89,10 @@ jobs: if: steps.add_entry.outputs.push_entry == 'YES' && steps.verify_user.outputs.result == 'YES' && steps.add_entry.outputs.has_issues == 'NO' working-directory: ${{ github.workspace }}/clicks run: | - git config --local user.email "${{ secrets.COOP_BOT_EMAIL }}" git config --local user.name "Click Sound Adder" git add -A git commit -m "New click from $ISSUE_AUTHOR - ${{ steps.add_entry.outputs.mod_id }}" + git config --local user.email "${{ secrets.COOP_BOT_EMAIL }}" git remote set-url origin "https://x-access-token:${{ secrets.COOP_BOT_PUSH_BIN_TOKEN }}@github.com/clicksounds/clicks.git" git push -u origin main env: @@ -120,5 +118,5 @@ jobs: with: issue-number: ${{ github.event.issue.number }} body: | - Waiting for a person who can approve to comment "!accept" to accept the entry. + Waiting for a person who can approve to comment "!accept" to accept the click sound request. ${{ steps.add_entry.outputs.issue_output }} \ No newline at end of file diff --git a/.github/workflows/issuecomment.yml b/.github/workflows/issuecomment.yml index 0faf3b3..8da5a44 100644 --- a/.github/workflows/issuecomment.yml +++ b/.github/workflows/issuecomment.yml @@ -11,7 +11,7 @@ env: jobs: check_issues: - name: + name: Check Issue runs-on: ubuntu-latest outputs: dirs: ${{ steps.dirs.outputs.dirs }} @@ -28,14 +28,12 @@ jobs: - name: Checkout Clicks Repo uses: actions/checkout@v4 with: - token: ${{ secrets.COOP_BOT_PUSH_BIN_TOKEN }} repository: clicksounds/clicks path: clicks - name: Checkout Mod Source uses: actions/checkout@v4 with: - token: ${{ secrets.COOP_BOT_PUSH_BIN_TOKEN }} repository: clicksounds/geode-clicksound path: modsource @@ -84,10 +82,10 @@ jobs: if: steps.verify_user.outputs.result == 'YES' && steps.add_entry.outputs.push_entry == 'YES' && github.event.comment.body == '!accept' working-directory: ${{ github.workspace }}/clicks run: | - git config --local user.email "${{ secrets.COOP_BOT_EMAIL }}" git config --local user.name "Click Sound Adder" git add -A git commit -m "New click from $ISSUE_AUTHOR - ${{ steps.add_entry.outputs.mod_id }}" -m "Accepted by: $COMMENT_AUTHOR" + git config --local user.email "${{ secrets.COOP_BOT_EMAIL }}" git remote set-url origin "https://x-access-token:${{ secrets.COOP_BOT_PUSH_BIN_TOKEN }}@github.com/clicksounds/clicks.git" git push -u origin main @@ -96,4 +94,4 @@ jobs: if: steps.verify_user.outputs.result == 'YES' && steps.add_entry.outputs.push_entry == 'YES' && github.event.comment.body == '!accept' with: issue-number: ${{ github.event.issue.number }} - comment: Successfully added the mod! \ No newline at end of file + comment: Successfully added your click sound!! \ No newline at end of file