Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions assets/in
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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"),
Expand Down