From 197149d0b76f8c648d925314763e2c2a01a08613 Mon Sep 17 00:00:00 2001 From: Nico Korthout Date: Fri, 24 Nov 2023 15:56:36 +0100 Subject: [PATCH] docs: only start backport by comment starting with 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 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 65891be..bbb4b93 100644 --- a/README.md +++ b/README.md @@ -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: > @@ -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