Skip to content

Commit

Permalink
Fix PR branch names
Browse files Browse the repository at this point in the history
  • Loading branch information
aenniw committed Oct 6, 2023
1 parent b8b8373 commit fd55886
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ctf-dump/writeup-to-gh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ REVIEWER=$2
git reset
base=$(git rev-parse --abbrev-ref HEAD)
for chal in $(git status . | grep modified | sed 's/.*modified:[ \t]*//g' | sed 's/\/.*$//g'); do
git branch "writeup/${chal// /-}"
git checkout "writeup/${chal// /-}"
branch=$(echo ${chal} | tr ' .' '-')

git branch "writeup/${branch}"
git checkout "writeup/${branch}"
git add "./${chal}"
git commit -S -m "Add ${CTF} - ${chal} writeup"
git push origin "writeup/${chal// /-}"
git push origin "writeup/${branch}"

if hash gh 2>/dev/null; then
issue=$(gh issue list -a @me -S "${chal}" | cut -f 1)
Expand Down

0 comments on commit fd55886

Please sign in to comment.