This commit is contained in:
Joachim Jablon
2021-07-23 23:53:16 +02:00
parent 2cedb8b908
commit 626fbd3669
3 changed files with 111 additions and 0 deletions

20
add-to-wiki.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/sh
# Usage $0 {repo/owner} {filename} {commit_message}
# Stores the content of stdin in a file named {filename} in the wiki of
# the provided repo
# Reads envvar GITHUB_TOKEN
set -eux
stdin=$(cat -)
repo_name=${1}
filename=${2}
commit_message=${3}
dir=$(mktemp -d)
cd $dir
git clone "https://${GITHUB_TOKEN}@github.com/${repo_name}.wiki.git" .
echo $stdin > ${filename}
git add ${filename}
git commit -m $commit_message
git push -u origin