Skip to content

Commit

Permalink
docs: only start backport by comment starting with
Browse files Browse the repository at this point in the history
the `contains`  expression can lead to unexpected action boot-loops when the error itself contains `/backport`.

This can be the case when a branch is includes the name "backport".

for example in a comment like this
```
error message .. in branch origin/backport-form-xx-to-xx
```

Using `startsWith` to reduce the likeliness of this issue.
https://docs.github.com/en/actions/learn-github-actions/expressions#startswith
  • Loading branch information
korthout committed Nov 24, 2023
1 parent f067bf0 commit 197149d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
runs-on: ubuntu-latest
# Only run when pull request is merged
# or when a comment containing `/backport` is created by someone other than the
# or when a comment starting with `/backport` is created by someone other than the
# https://github.com/backport-action bot user (user id: 97796249). Note that if you use your
# own PAT as `github_token`, that you should replace this id with yours.
if: >
Expand All @@ -90,7 +90,7 @@ jobs:
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.comment.user.id != 97796249 &&
contains(github.event.comment.body, '/backport')
startsWith(github.event.comment.body, '/backport')
)
steps:
- uses: actions/checkout@v4
Expand Down

0 comments on commit 197149d

Please sign in to comment.