From fd55886fbb9e65b6c10dbae310bf6c09f9bd31d5 Mon Sep 17 00:00:00 2001 From: Martin Mihalek Date: Fri, 6 Oct 2023 09:30:21 +0200 Subject: [PATCH] Fix PR branch names --- ctf-dump/writeup-to-gh.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ctf-dump/writeup-to-gh.sh b/ctf-dump/writeup-to-gh.sh index d02f2e6..2697678 100755 --- a/ctf-dump/writeup-to-gh.sh +++ b/ctf-dump/writeup-to-gh.sh @@ -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)