-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,5 +19,41 @@ inputs: | |
runs: | ||
using: composite | ||
steps: | ||
- run: update-step.sh | ||
shell: bash | ||
- shell: bash | ||
run: | | ||
echo "Check that we are on FROM_STEP" | ||
if [ "$(cat .github/script/STEP)" != $FROM_STEP ] | ||
then | ||
echo "Current step is not $FROM_STEP" | ||
exit 0 | ||
fi | ||
echo "Make sure we are on the main branch" | ||
git checkout main | ||
echo "Remove 'open' from any <details> tags" | ||
sed -i.tmp -r 's/<details id=([0-9]+) open>/<details id=\1>/g' README.md | ||
echo "Add 'open' to step TO_STEP" | ||
sed -i.tmp -r "s/<details id=$TO_STEP>/<details id=$TO_STEP open>/g" README.md | ||
echo "Update the STEP file to TO_STEP" | ||
echo "$TO_STEP" > .github/script/STEP | ||
echo "Commit the files, and push to main" | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git add README.md | ||
git add .github/script/STEP | ||
git commit --message="Update to $TO_STEP in STEP and README.md" | ||
git push | ||
echo "If BRANCH_NAME, update that branch as well" | ||
if git show-ref --quiet refs/heads/$BRANCH_NAME | ||
then | ||
git checkout $BRANCH_NAME | ||
git cherry-pick main | ||
git push | ||
else | ||
echo "Branch $BRANCH_NAME does not exist" | ||
fi |