forked from SWTCG/SWTCG-LACKEY
-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (30 loc) · 1.12 KB
/
Copy pathvalidate-commit.yml
File metadata and controls
30 lines (30 loc) · 1.12 KB
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
name: validate-commit
on: [push]
env:
DISCORD_NAME: coder
FILE_SIZE: 0
jobs:
validate-commit:
runs-on: ubuntu-latest
steps:
- name: Report branch info
run: |
echo "Detected push to ${{ github.ref }} by $GITHUB_ACTOR"
- name: Check out repository code
uses: actions/checkout@v3
- name: Validate the plugin
run: |
python3 missingCardFinder.py > output.txt && cat output.txt
- name: Check for output
run: |
export FILESIZE=$(wc -c output.txt | awk '{print $1}') && echo "FILE_SIZE=$FILESIZE" >> $GITHUB_ENV
- name: Find Discord user
run: |
export USERCODE=$(cat .github/workflows/usernames.json | jq -r ."$GITHUB_ACTOR") && echo "DISCORD_NAME=$USERCODE" >> $GITHUB_ENV
- name: Send discord message
uses: tsickert/discord-webhook@v4.0.0
if: ${{env.FILE_SIZE != '0'}}
with:
webhook-url: ${{ secrets.validationWebhook }}
filename: output.txt
content: Hey ${{ env.DISCORD_NAME }}, it looks like there was an error with your last plugin commit on branch ${{ github.ref }}.