Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added myself to the hero list #1

Merged
merged 27 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
65f634f
Added myself to the hero list
jordangov Jul 2, 2024
939e8f3
Merge branch 'main' into test
jordangov Jul 2, 2024
7f86bd5
added calculation of submission and checksum
jordangov Jul 2, 2024
5ca6404
adding fetch depth to compare with main
jordangov Jul 2, 2024
840e653
go to head before doiing diff
jordangov Jul 2, 2024
6a85aa5
fetch main from origin before diffing
jordangov Jul 2, 2024
3cc371d
extract only checksum and conpare results with message
jordangov Jul 2, 2024
91063ca
checksum needs work, and addign pipeline failure
jordangov Jul 2, 2024
58351f5
trying to resolve the checksum parsing
jordangov Jul 2, 2024
e22807d
trying to resolve the checksum parsing
jordangov Jul 2, 2024
96120f2
trying to resolve the checksum parsing
jordangov Jul 2, 2024
66f5831
trying to resolve the checksum parsing
jordangov Jul 2, 2024
7cd3a96
trying to resolve the checksum parsing
jordangov Jul 2, 2024
f0c5da6
trying to resolve the checksum parsing
jordangov Jul 2, 2024
94cee4a
trying to resolve the checksum parsing
jordangov Jul 2, 2024
214b570
fixed job name
jordangov Jul 2, 2024
9383197
testing posting a message to the PR
jordangov Jul 2, 2024
96861d5
testing posting a message to the PR
jordangov Jul 2, 2024
53ab0a3
testing posting a message to the PR
jordangov Jul 2, 2024
b09f720
testing posting a message to the PR
jordangov Jul 2, 2024
2a66988
testing posting a message to the PR
jordangov Jul 2, 2024
2ce9bec
testing posting a message to the PR
jordangov Jul 2, 2024
8eccd68
testing posting a message to the PR
jordangov Jul 2, 2024
2ee06c6
testing posting a message to the PR
jordangov Jul 2, 2024
0a9eef4
testing the negative condition
jordangov Jul 2, 2024
ca1a7ad
final touches for v1
jordangov Jul 2, 2024
2f20b9a
fixing typo
jordangov Jul 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 41 additions & 6 deletions .github/workflows/hero-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,52 @@ on:
branches: [ "main" ]

jobs:
test:
check-for-hero:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Checkout Code
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}}
- name: Run script
run: |
echo "user: ${{github.actor}}"
echo -n "${{github.actor}}-${{secrets.SALT}}" | openssl dgst -${{secrets.ALGO}}
fetch-depth: 0
- name: Check Submission
id: check_sub
run: >-
git fetch origin main;
SUBMISSION=`git diff origin/main..HEAD open-source-heroes.md | awk '/\* @${{github.actor}}/{ print $3 }'`;
echo -n "${{github.actor}}-${{secrets.SALT}}" | openssl dgst -${{secrets.ALGO}};
CHECKSUM=`echo -n "${{github.actor}}-${{secrets.SALT}}" | openssl dgst -${{secrets.ALGO}} | awk '/[a-z0-9]+/{ print $2 }'`;
echo "Confirming submission ($SUBMISSION) equals checksum...";
if [[ "$SUBMISSION" = "$CHECKSUM" ]]; then
echo "Submissions match, they're an open source hero!"
echo "RESULT=pass" >> "$GITHUB_OUTPUT";
echo "MESSAGE='🤩 Wow, you are an open source hero! Find a volunteer with the special White House badge to claim your fame!'" >> "$GITHUB_OUTPUT";
else
echo "Submissions do not match, need to try again."
echo "RESULT=fail" >> "$GITHUB_OUTPUT";
echo "MESSAGE='😔 Sorry, but that is not the right hash. Have you found all of the clues?'" >> "$GITHUB_OUTPUT";
fi
- name: Post Message
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: ${{ steps.check_sub.outputs.MESSAGE }}
})
- name: End Job
env:
RESULT: ${{ steps.check_sub.outputs.RESULT }}
run: >-
echo "RESULT=$RESULT";
if [[ "$RESULT" = "pass" ]]; then
exit 0;
else
exit 1;
fi
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# DEF CON 32 Open Source Heros
# DEF CON 32 Open Source Heroes

> This repo is a **proof of concept** for the Open Source Hero Badge at DEF CON 32.
>
> Check out the [open-source-heroes.md](open-source-heroes.md) file for instructions.
5 changes: 3 additions & 2 deletions open-source-heros.md → open-source-heroes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Open Source Heros
# Open Source Heroes

This is the list of heros. Add your name to the list below with your GitHub handle and the correct hash.
This is the list of heroes. Add your name to the list below with your GitHub handle and the correct hash.

> **INSTRUCTIONS**: You must open a Pull Request to this repository, correctly adding your name to the list below along with the correct hash per the hints you have found elsewhere during DEF CON 32.
>
Expand All @@ -12,3 +12,4 @@ This is the list of heros. Add your name to the list below with your GitHub hand
## The List

* @whitehouse 7e2aac5579f5e3fb61c2ba63f95cfb7a87cb3da8
* @jordangov 6119660cad1e64ddc93cde48e2d617e3cc00071e