Skip to content

Commit ba4edd2

Browse files
[bitbucket pipelines] allow commit arg to be optional when only pattern is passed in pipeline trigger api (#848)
* [bitbucket pipelines] allow commit arg to be optional when only pattern is passed * remove condition to check that both are empty * fix line break and modify doc Co-authored-by: Arvind <arvind.kalyan@suprdaily.com>
1 parent 3ee13e3 commit ba4edd2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

atlassian/bitbucket/cloud/repositories/pipelines.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def trigger(self, branch="master", commit=None, pattern=None, variables=None):
2121
2222
1. Latest revision of a branch (specify ``branch``)
2323
2. Specific commit on a branch (additionally specify ``commit``)
24-
3. Specific pipeline (additionally specify ``pattern``)
24+
3. Specific pipeline (additionally specify ``pattern``. ``commit`` is optional here)
2525
2626
Variables has to be a list of dictionaries:
2727
@@ -48,8 +48,6 @@ def trigger(self, branch="master", commit=None, pattern=None, variables=None):
4848
"hash": commit,
4949
}
5050
if pattern is not None:
51-
if commit is None:
52-
raise ValueError("Missing argument [commit].")
5351
data["target"]["selector"] = {
5452
"type": "custom",
5553
"pattern": pattern,

0 commit comments

Comments
 (0)