From 188c4b4afa40366b09dec059019e9ffb4b32d288 Mon Sep 17 00:00:00 2001 From: Kevin Guillaumond Date: Fri, 27 May 2022 11:05:07 -0700 Subject: [PATCH] docs: Add suggested config to enable manual runs (#17) It has happened that a workflow didn't run because GitHub was having problems. This would also help if you wanted to re-sync a wiki page because you've upgraded the script. --- README.rst | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.rst b/README.rst index a42427d..bcd82d6 100644 --- a/README.rst +++ b/README.rst @@ -56,6 +56,9 @@ It is recommended to save the Confluence token as a GitHub secret. Configuration ------------- +Optional parameters +=================== + The Getting Started example shows all the required parameters. Check out `action.yml <./action.yml>`_ to get the list of configuration options. @@ -70,6 +73,33 @@ space-separated list: ignored_folders: 'foo/ bar/baz/' [...] +Manual runs +=========== + +Sometimes it can be useful to run the workflow manually for certain files. You +can add a ``workflow_dispatch`` trigger to your workflow, and get the list of +files to sync from its input parameter: + +.. code-block:: yaml + + workflow_dispatch: # Manual trigger + inputs: + files-to-sync: + description: 'Space-separated list of files to synchronize' + required: true + type: string + + [...] + + - name: Get modified files from user input + if: github.event_name == 'workflow_dispatch' + run: echo "MODIFIED_FILES=${{ github.event.inputs.files-to-sync}}" >> $GITHUB_ENV + + - name: Get modified files from git diff + if: github.event_name != 'workflow_dispatch' + run: echo "MODIFIED_FILES=`git diff HEAD^ --name-only | xargs`" >> $GITHUB_ENV + + ----------- Development -----------