Skip to content
This repository was archived by the owner on Dec 25, 2021. It is now read-only.

Commit 39cb32c

Browse files
committed
Add input option for README.md creation
1 parent 1367664 commit 39cb32c

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Setup workflow at branch `master` or `docs` may be a good idea.
2626
- uses: seanzhengw/sphinx-pages@master
2727
with:
2828
github_token: ${{ secrets.GITHUB_TOKEN }}
29+
create_readme: true
2930

3031
## Example Usage for standalone Sphinx documentation
3132

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ inputs:
88
github_token:
99
description: 'Token for the repo. Can be passed in using $\{{ secrets.GITHUB_TOKEN }}'
1010
required: true
11+
create_readme:
12+
description: 'Auto create a README.md file at branch gh-pages root with repo/branch/commit links'
13+
default: false
1114
outputs:
1215
name:
1316
description: 'Author name'

entrypoint.sh

100644100755
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ git config user.email $author_email
8282
echo "sphinx-build -b html $docs_src/source $docs_html -E -d $sphinx_doctree"
8383
sphinx-build -b html $docs_src/source $docs_html -E -d $sphinx_doctree
8484

85+
# auto creation of README.md
86+
if [ "$INPUT_CREATE_README" = true ] ; then
87+
echo "Create file README.md"
88+
echo "GitHub Pages of [$GITHUB_REPOSITORY](https://github.com/$GITHUB_REPOSITORY.git)" > README.md
89+
echo "===" >> README.md
90+
echo "Sphinx html documentation of [$docs_sha8](https://github.com/$GITHUB_REPOSITORY/tree/$GITHUB_SHA)" >> README.md
91+
fi
92+
8593
# commit and push
8694
echo "git add ."
8795
git add .

0 commit comments

Comments
 (0)