-
Notifications
You must be signed in to change notification settings - Fork 1
146 lines (121 loc) · 4.77 KB
/
issuecomment.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Review Entry
on:
issue_comment:
types: [created]
env:
PR_AUTHOR: ${{ github.event.issue.user.login }}
ISSUE_AUTHOR: ${{ github.event.issue.user.login }}
COMMENT_AUTHOR: ${{ github.event.comment.user.login }}
jobs:
check_issues:
name: Check Issue
runs-on: ubuntu-latest
outputs:
dirs: ${{ steps.dirs.outputs.dirs }}
verified: ${{ steps.verify.outputs.verify }}
if: ${{ !github.event.issue.pull_request }}
steps:
- name: Checkout Clicks Indexer
uses: actions/checkout@v4
with:
path: code
- name: Checkout Clicks Repo
uses: actions/checkout@v4
with:
repository: clicksounds/clicks
path: clicks
token: ${{ secrets.COOP_BOT_PUSH_BIN_TOKEN }}
- name: Checkout Mod Source
uses: actions/checkout@v4
with:
repository: clicksounds/geode-clicksound
path: modsource
- name: Verify User
id: verify_user
shell: bash
run: |
echo result=`python3 code/.github/verify2.py modsource $COMMENT_AUTHOR` >> $GITHUB_OUTPUT
env:
COMMENT_AUTHOR: ${{ github.event.comment.user.login }}
- name: Make Test Directory
if: steps.verify_user.outputs.result == 'YES' && github.event.comment.body == '!accept'
run: mkdir test
- name: Download File
continue-on-error: true
if: steps.verify_user.outputs.result == 'YES' && github.event.comment.body == '!accept'
id: download_file
uses: nick-fields/retry@v3
with:
timeout_minutes: 2
max_attempts: 5
shell: bash
command: |
set +e
python3 code/.github/DOWNLOAD_FILE.py >> result.txt
RESULT=$?
set -e
cat result.txt
echo "any silly errors?"
if [ -f silly_log.txt ]; then
cat silly_log.txt
fi
if [ $RESULT -eq 0 ]; then
echo "Download successful, proceeding with next steps."
exit 0
else
echo "Download failed, retrying..."
exit 1
fi
env:
ISSUE_AUTHOR: ${{ github.event.issue.user.login }}
COMMENT_AUTHOR: ${{ github.event.comment.user.login }}
ISSUE_BODY: ${{ github.event.issue.body }}
- name: Unzip Downloaded File
continue-on-error: true
if: steps.verify_user.outputs.result == 'YES' && github.event.comment.body == '!accept' && steps.download_file.outputs.issue_err == ''
run: |
7z x "./test/yessir.zip" -o"./test/yessir"
- name: Add Entry
if: steps.verify_user.outputs.result == 'YES' && github.event.comment.body == '!accept' && steps.download_file.outputs.issue_err == ''
id: add_entry
shell: bash
run: |
set +e
python3 code/.github/issue.py clicks $ISSUE_AUTHOR >> result.txt
RESULT=$?
set -e
cat result.txt
echo "any silly errors?"
if [ -f silly_log.txt ]; then
cat silly_log.txt
fi
if [ $RESULT -eq 0 ]; then
echo push_entry=YES >> $GITHUB_OUTPUT
else
echo push_entry=NO >> $GITHUB_OUTPUT
fi
env:
ISSUE_AUTHOR: ${{ github.event.issue.user.login }}
COMMENT_AUTHOR: ${{ github.event.comment.user.login }}
ISSUE_BODY: ${{ github.event.issue.body }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
VERIFY_USER_RESULT: ${{ steps.verify_user.outputs.result }}
ACTUALLY_ACCEPTING: YES
- name: Push to clicks repository
shell: bash
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 --global user.name "$ISSUE_AUTHOR" || git config --global user.name "Click Sounds Adder"
git config --global user.email "${{ github.event.issue.user.email }}" || echo "user doesn't have an email"
git add -A
git commit -m "New click - ${{ steps.add_entry.outputs.mod_id }}" -m "Accepted by: $COMMENT_AUTHOR"
git config --global user.email "${{ secrets.COOP_BOT_EMAIL }}"
git remote set-url origin "https://coopeeobot:${{ secrets.COOP_BOT_PUSH_BIN_TOKEN }}@github.com/clicksounds/clicks.git"
git push -u origin main
- name: Close Issue
uses: peter-evans/close-issue@v3
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 your click sound!!