Skip to content

Commit

Permalink
Merge pull request #19 from zarplata/deprecate-source-dir
Browse files Browse the repository at this point in the history
Deprecate source.dir in favor to out.params.repository
  • Loading branch information
idr0id authored Jan 31, 2019
2 parents 6e45ebf + a0f57e1 commit f364c07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ For example: `http://bitbucket.local`
resource](https://github.com/concourse/git-resource). The `branch` configuration
from the original resource is ignored.
* `bitbucket_type`: *Optional*. `cloud` for BitBucket Cloud or `server` for a self-hosted BitBucket Server. `default: server`
* `dir`: *Optional*. set to name of the resource if resource name is different than repository name
* `dir`: *Deprecated*. set to name of the resource if resource name is different than repository name. Is deprecated in favor to `params.repository` in `out`.
* `branch`: *Optional*. if given, only pull requests against this branch will be checked

### Example
Expand Down Expand Up @@ -102,8 +102,9 @@ This updates the build status of the pull request commit.

#### Parameters

Parameters except the `name` will be respected the [Bitbucket documentation](https://developer.atlassian.com/server/bitbucket/how-tos/updating-build-status-for-commits/).
The `name` parameter is deprecated and has been left only for backward compatibility.
* Parameters except the `name` will be respected the [Bitbucket documentation](https://developer.atlassian.com/server/bitbucket/how-tos/updating-build-status-for-commits/).
* `name`: `Deprecated`. Parameter is deprecated and has been left only for backward compatibility.
* `repository`: `Optional`. The path of the source repository for pushing or changing build status.

## Troubleshooting

Expand Down
4 changes: 2 additions & 2 deletions assets/out
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ username=$(jq -r '.source.username // ""' < "${payload}")
password=$(jq -r '.source.password // ""' < "${payload}")
project=$(jq -r '.source.project // ""' < "${payload}")
repository=$(jq -r '.source.repository // ""' < "${payload}")
dir=$(jq -r '.source.dir // ""' < "${payload}")
dir=$(jq -r '.params.repository // .source.dir // .source.repository // ""' < "${payload}")
params=$(jq -rc '.params' < "${payload}")

cd "${dir:-$repository}"
cd "${dir}"

pr=$(cat pull-request-info)

Expand Down

0 comments on commit f364c07

Please sign in to comment.