Skip to content

Commit

Permalink
[bitbucket pipelines] allow commit arg to be optional when only patte…
Browse files Browse the repository at this point in the history
…rn 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 <[email protected]>
  • Loading branch information
arvind-kalyan and arvind-swiggy authored Aug 28, 2021
1 parent 3ee13e3 commit ba4edd2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions atlassian/bitbucket/cloud/repositories/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def trigger(self, branch="master", commit=None, pattern=None, variables=None):
1. Latest revision of a branch (specify ``branch``)
2. Specific commit on a branch (additionally specify ``commit``)
3. Specific pipeline (additionally specify ``pattern``)
3. Specific pipeline (additionally specify ``pattern``. ``commit`` is optional here)
Variables has to be a list of dictionaries:
Expand All @@ -48,8 +48,6 @@ def trigger(self, branch="master", commit=None, pattern=None, variables=None):
"hash": commit,
}
if pattern is not None:
if commit is None:
raise ValueError("Missing argument [commit].")
data["target"]["selector"] = {
"type": "custom",
"pattern": pattern,
Expand Down

0 comments on commit ba4edd2

Please sign in to comment.