Skip to content

Commit

Permalink
docs: Add suggested config to enable manual runs (#17)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
KevinGDialpad authored May 27, 2022
1 parent 26926cd commit 188c4b4
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
-----------
Expand Down

0 comments on commit 188c4b4

Please sign in to comment.