diff --git a/README.md b/README.md index 8c7e038..a7eaa63 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ replacing every `-` (dash) character with a space. Name your files accordingly. The `Home.md` file will automatically become the homepage, not `README.md`. This is specific to GitHub wikis. -### Options +### Inputs - **`strategy`:** Select from `clone` or `init` to determine which method to use to push changes to the GitHub wiki. `clone` will clone the `.wiki.git` repo @@ -116,7 +116,7 @@ is specific to GitHub wikis. not push to the remote wiki. The default is `false`. This is useful for testing. -#### `strategy:` option +#### `strategy:` input There are some specific usecases where using `strategy: init` might be better than the default `strategy: clone`. @@ -132,6 +132,12 @@ than the default `strategy: clone`. push using `strategy: init` on each wiki deployment and none of that pesky history will be saved. +### Outputs + +- **`wiki_url`:** The HTTP URL that points to the deployed repository's wiki + tab. This is essentially the concatenation of `${{ github.server_url }}`, + `${{ github.repository }}`, and the `/wiki` page. + ### Preprocessing You may wish to strip the `[link](page.md)` `.md` suffix from your links to make diff --git a/action.yml b/action.yml index 2d8f3da..f1b1de7 100644 --- a/action.yml +++ b/action.yml @@ -64,10 +64,18 @@ inputs: push to the remote wiki. The default is false. This is useful for testing. required: true default: false +outputs: + wiki_url: + description: >- + The HTTP URL that points to the deployed repository's wiki tab. This is + essentially the concatenation of github.server_url, github.repository, and + the /wiki page. + value: ${{ steps.main.outputs.wiki_url }} runs: using: composite steps: - - run: '"${GITHUB_ACTION_PATH%/}/src/$INPUT_STRATEGY.sh"' + - id: main + run: '"${GITHUB_ACTION_PATH%/}/src/$INPUT_STRATEGY.sh"' shell: bash env: INPUT_STRATEGY: ${{ inputs.strategy }} diff --git a/src/clone.sh b/src/clone.sh index 24e7606..e3dfd60 100755 --- a/src/clone.sh +++ b/src/clone.sh @@ -37,3 +37,4 @@ if [[ $INPUT_DRY_RUN == true ]]; then fi git push origin master +echo "wiki_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/wiki" >>"$GITHUB_OUTPUT" diff --git a/src/init.sh b/src/init.sh index ec26683..e5f55d5 100755 --- a/src/init.sh +++ b/src/init.sh @@ -37,3 +37,4 @@ if [[ $INPUT_DRY_RUN == true ]]; then fi git push -f origin master +echo "wiki_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/wiki" >>"$GITHUB_OUTPUT"