Skip to content

Commit

Permalink
Merge pull request #10 from brakel/deprecate-skip-download-param
Browse files Browse the repository at this point in the history
📝 Deprecate `skip_download` in favour of `no_get`
  • Loading branch information
Benjamintf1 authored Aug 8, 2024
2 parents 09539a9 + 6514b62 commit 4fbaccb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
17 changes: 1 addition & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ generate notifications over the webhook. So if you have a repository with little

| Parameter | Required | Example | Description |
|----------------------|----------|----------|------------------------------------------------------------------------------------|
| `skip_download` | No | `true` | Use with `get_params` in a `put` step to do nothing on the implicit get. |
| `skip_download` | No | `true` | (deprecated) Use `no_get` on the put step instead. |
| `integration_tool` | No | `rebase` | The integration tool to use, `merge`, `rebase` or `checkout`. Defaults to `merge`. |
| `git_depth` | No | `1` | Shallow clone the repository using the `--depth` Git option |
| `submodules` | No | `true` | Recursively clone git submodules. Defaults to false. |
Expand Down Expand Up @@ -129,21 +129,6 @@ is available as `.git/resource/base_sha`. For a complete list of available (indi
- `title`: the title of the pull request
- `url`: the URL for the pull request


When specifying `skip_download` the pull request volume mounted to subsequent tasks will be empty, which is a problem
when you set e.g. the pending status before running the actual tests. The workaround for this is to use an alias for
the `put` (see telia-oss/github-pr-resource#32 for more details).
Example here:

```yaml
put: update-status <-- Use an alias for the pull-request resource
resource: pull-request
params:
path: pull-request
status: pending
get_params: {skip_download: true}
```
git-crypt encrypted repositories will automatically be decrypted when the `git_crypt_key` is set in the source configuration.

Note that, should you retrigger a build in the hopes of testing the last commit to a PR against a newer version of
Expand Down
2 changes: 2 additions & 0 deletions in.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"strconv"
Expand All @@ -12,6 +13,7 @@ import (
// Get (business logic)
func Get(request GetRequest, github Github, git Git, outputDir string) (*GetResponse, error) {
if request.Params.SkipDownload {
log.Print("`skip_download` has been deprecated, use `no_get` instead to prevent this implicit get step from running.")
return &GetResponse{Version: request.Version}, nil
}

Expand Down

0 comments on commit 4fbaccb

Please sign in to comment.