mirror of
https://github.com/BtbN/FFmpeg-Builds.git
synced 2025-06-12 05:17:39 +02:00
Update Wiki-Page with latest releases
This commit is contained in:
35
util/update_wiki.sh
Executable file
35
util/update_wiki.sh
Executable file
@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ $# != 2 ]]; then
|
||||
echo "Missing arguments"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
if [[ -z "$GITHUB_REPOSITORY" || -z "$GITHUB_TOKEN" || -z "$GITHUB_ACTOR" ]]; then
|
||||
echo "Missing environment"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
INPUTS="$1"
|
||||
TAGNAME="$2"
|
||||
|
||||
WIKIPATH="tmp_wiki"
|
||||
WIKIFILE="Latest.md"
|
||||
git clone "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.wiki.git" "${WIKIPATH}"
|
||||
|
||||
echo "# Latest Autobuilds" > "${WIKIPATH}/${WIKIFILE}"
|
||||
for f in "${INPUTS}"/*.txt; do
|
||||
VARIANT="${f::-4}"
|
||||
echo "[${VARIANT}](https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAGNAME}/$(cat "${f}"))" >> "${WIKIPATH}/${WIKIFILE}"
|
||||
done
|
||||
|
||||
cd "${WIKIPATH}"
|
||||
git config user.email "actions@github.com"
|
||||
git config user.name "Github Actions"
|
||||
git add "$WIKIFILE"
|
||||
git commit -m "Update latest version info"
|
||||
git push
|
||||
|
||||
cd ..
|
||||
rm -rf "$WIKIPATH"
|
Reference in New Issue
Block a user