Skip to content

Commit

Permalink
Update action.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
heiskr authored Mar 4, 2022
1 parent 97f853c commit 8b271ef
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8b271ef

Please sign in to comment.