Skip to content

Commit

Permalink
Do this shit AND WORK FIRST TRYT
Browse files Browse the repository at this point in the history
  • Loading branch information
coopeeo authored Mar 25, 2024
1 parent 45609eb commit d38758c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
20 changes: 19 additions & 1 deletion .github/issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand All @@ -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 }}
8 changes: 3 additions & 5 deletions .github/workflows/issuecomment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:

jobs:
check_issues:
name:
name: Check Issue
runs-on: ubuntu-latest
outputs:
dirs: ${{ steps.dirs.outputs.dirs }}
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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!
comment: Successfully added your click sound!!

0 comments on commit d38758c

Please sign in to comment.