From 3cd242296f29a96dbc6a7d788158e535176c18b0 Mon Sep 17 00:00:00 2001 From: dkamyshov Date: Sat, 5 Sep 2020 11:44:50 +0300 Subject: [PATCH 1/2] Add base branch to exposed configuration --- assets/in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assets/in b/assets/in index 869e5f5..9a573b1 100755 --- a/assets/in +++ b/assets/in @@ -148,6 +148,7 @@ if [ "$prq" != "NO_SUCH_PULL_REQUEST" ] && \ [ "$prq" != "ALREADY_MERGED" ] && \ [ "$prq" != "DECLINED" ]; then branch=$(echo "$prq" | jq -r '.fromRef.displayId') + base_branch=$(echo "$prq" | jq -r '.toRef.displayId') fi @@ -158,6 +159,7 @@ git config --add pullrequest.target $target_commit git config --add pullrequest.merge $ref git config --add pullrequest.date "$prq_date" git config --add pullrequest.branch "$branch" +git config --add pullrequest.base "$base_branch" jq -n "{ version: $(jq '.version' < "$payload"), From 63aaae913840dd7cdd7ac5a8e6a2c13f382eb2b2 Mon Sep 17 00:00:00 2001 From: dkamyshov Date: Sat, 5 Sep 2020 11:45:29 +0300 Subject: [PATCH 2/2] Add the list of parameters to docs --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c393f49..9245eb4 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,19 @@ It will allow you to build all versions instead of only the latest. Submodules are initialized and updated recursively. -Note: the name of the branch from which the pull request has been created is stored in the special git config `pullrequest.branch` so that you can use it as reference in your pipeline. +Note: this resource stores some parameters in the git config. Here is the list: + +| Key | Comment | +| -------------------- | ---------------------- | +| `pullrequest.id` | Pull request ID. | +| `pullrequest.source` | Source git commit ref. | +| `pullrequest.target` | Target git commit ref. | +| `pullrequest.merge` | Merge commit ref. | +| `pullrequest.date` | PR date. | +| `pullrequest.branch` | Source branch. | +| `pullrequest.base` | Target branch. | + +Run `$ git config [key]` to retrieve data. #### Parameters