diff --git a/README.adoc b/README.adoc index d5a6945..09ff5d3 100644 --- a/README.adoc +++ b/README.adoc @@ -34,7 +34,22 @@ If the pattern is found, it looks up the issue `` and closes the backpor The application is intended to be run as a GitHub Action. Here is an example workflow: -NOTE: The workflow should be present on every branch that you wish to be supported (branches is a filter and the workflow https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#about-workflow-triggers[will not operate] on branches that the workflow is not defined on). +[NOTE] +==== +The workflow should be present on every branch that you wish to be supported. + +From GItHub's Actions documentation: + +> Each workflow run will use the version of the workflow that is present in the associated commit SHA or Git ref of the event.  +This means that when a commit is pushed to these branches, it will not be processed by the backport bot because the workflow is not defined on those branches. + +This can be a bit confusing when you see the https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#running-your-workflow-only-when-a-push-to-specific-branches-occurs[branches] element specify that it should operate only on branches that match `*.x`. +However, it is important that the branches entry operates as a https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#using-filters[filter] that further reduces the events that are operated on. +It will not process an event that would not otherwise be processed (e.g. if the workflow does not exist on a branch that belongs to the event). + +The usage of these types of filters is primarily meant to ensure that when you create new branches that you can prevent accidental invocation of workflows in branches without having to remember to remove the workflow in the branches. +It also has the benefit of simplifying merging strategies for commits that involve the workflows. +==== .backport-bot.yml [source,yml] @@ -71,3 +86,11 @@ jobs: run: java -jar backport-bot-0.0.1-SNAPSHOT.jar --github.accessToken="$GITHUB_TOKEN" --github.event_name "$GITHUB_EVENT_NAME" --github.event "$GITHUB_EVENT" ---- + +[add-every-branch] +.Add the Workflow to Every Branch +**** + + + +****