-
Notifications
You must be signed in to change notification settings - Fork 5
31 lines (29 loc) · 1012 Bytes
/
hero-check.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
name: Hero Check
on:
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
repository: jordangov/defcon-poc
# token needss to be able read repo contents, write to PRs, and read secrets
token: ${{secrets.GH_TOKEN}}
fetch-depth: 0
- name: Run script
run: >-
git fetch origin main;
SUBMISSION=`git diff origin/main..HEAD open-source-heros.md | awk '/\* @${{github.actor}}/{ print $3 }'`;
CHECKSUM=`echo -n "${{github.actor}}-${{secrets.SALT}}" | openssl dgst -${{secrets.ALGO}}` | awk '/[a-z0-9]+/{ print $0 }';
echo "Confirming submission ($SUBMISSION) equals checksum ($CHECKSUM)...";
if [[ "$SUBMISSION" = "$CHECKSUM" ]]; then
echo "You are an open source hero!";
exit 0;
else
echo "Try again!";
exit 1;
fi