From 77505cd490d1def10710f9efdf94b6be156739f0 Mon Sep 17 00:00:00 2001 From: Jacob Hummer Date: Fri, 9 Jun 2023 16:26:34 -0500 Subject: [PATCH 1/3] Add output logic to scripts --- src/clone.sh | 1 + src/init.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/src/clone.sh b/src/clone.sh index cedd2f4..37d1608 100755 --- a/src/clone.sh +++ b/src/clone.sh @@ -115,3 +115,4 @@ fi # to that 'github.com' hostname! We aren't using -u or -f here since there # shouldn't be a need. 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 4466ac8..dae75d4 100755 --- a/src/init.sh +++ b/src/init.sh @@ -82,3 +82,4 @@ if [[ $INPUT_DRY_RUN == true ]]; then fi git push -f origin master +echo "wiki_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/wiki" >>"$GITHUB_OUTPUT" From efcec93534d6d333001065ed130b4d6d61730baa Mon Sep 17 00:00:00 2001 From: Jacob Hummer Date: Fri, 9 Jun 2023 16:26:46 -0500 Subject: [PATCH 2/3] Add output exposure to action.yml --- action.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 }} From 699f1da43f5fd60699bca0b499755af939230954 Mon Sep 17 00:00:00 2001 From: Jacob Hummer Date: Fri, 9 Jun 2023 16:28:21 -0500 Subject: [PATCH 3/3] Add description to the readme --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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