From 23a8e99b6bc62e5973a8ca2c6e5a8b72451c768c Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 9 Oct 2021 05:17:19 +0100 Subject: [PATCH] Add revs update script --- scripts/update-revs.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 scripts/update-revs.sh diff --git a/scripts/update-revs.sh b/scripts/update-revs.sh new file mode 100755 index 0000000..db38964 --- /dev/null +++ b/scripts/update-revs.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." + +if ! git diff-index --quiet HEAD; then + echo "Not running update-revs.sh because git working directory is dirty" >&2 + exit 1 +fi + +base=$(git rev-parse HEAD) +git checkout --quiet "$base" + +for rev in 1.{0..60}.0 stable beta nightly; do + echo "Updating $rev branch" + git branch --quiet --delete --force $rev &>/dev/null || true + sed -i "s/required: true/required: false\n default: $rev/" action.yml + git add action.yml + git commit --quiet --message "toolchain: $rev" + git checkout --quiet -b $rev + git checkout --quiet "$base" +done