Skip to content

Commit

Permalink
feat: Add option to use HTML comments instead of details/summary (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
heiskr authored May 11, 2022
1 parent 48ed9f0 commit 6444e3c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,19 @@ runs:
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
sed -i.tmp -r 's/<details id=([0-9X]+) 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 all HTML comments to hide everything"
sed -i.tmp -r 's/<!--step([0-9X]+)-->/<!--step\1/g' README.md
sed -i.tmp -r 's/<!--endstep([0-9X]+)-->/endstep\1-->/g' README.md
echo "Show the current TO_STEP"
sed -i.tmp -r "s/<\!--step$TO_STEP/<\!--step$TO_STEP-->/g" README.md
sed -i.tmp -r "s/endstep$TO_STEP-->/<\!--endstep$TO_STEP-->/g" README.md
echo "Update the STEP file to TO_STEP"
echo "$TO_STEP" > .github/script/STEP
Expand Down

0 comments on commit 6444e3c

Please sign in to comment.