Skip to content

Commit

Permalink
Merge branch 'master' into status-check-filter
Browse files Browse the repository at this point in the history
  • Loading branch information
rickardl authored Oct 19, 2020
2 parents 2092760 + c41729d commit bad7c2b
Show file tree
Hide file tree
Showing 13 changed files with 313 additions and 139 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ sudo: false
matrix:
include:
- os: osx
go: 1.13.x
go: 1.14.x
- os: linux
go: 1.13.x
go: 1.14.x
notifications:
email: false
script:
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
FROM golang:1.13 as builder
FROM golang:1.14 as builder
ADD . /go/src/github.com/telia-oss/github-pr-resource
WORKDIR /go/src/github.com/telia-oss/github-pr-resource
RUN curl -sL https://taskfile.dev/install.sh | sh
RUN ./bin/task build

FROM alpine:3.8 as resource
FROM alpine:3.11 as resource
COPY --from=builder /go/src/github.com/telia-oss/github-pr-resource/build /opt/resource
RUN apk add --update --no-cache \
git \
openssh \
&& chmod +x /opt/resource/*
COPY scripts/askpass.sh /usr/local/bin/askpass.sh
ADD scripts/install_git_crypt.sh install_git_crypt.sh
RUN ./install_git_crypt.sh && rm ./install_git_crypt.sh

Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Make sure to check out [#migrating](#migrating) to learn more.
| `access_token` | Yes | | A Github Access Token with repository access (required for setting status on commits). N.B. If you want github-pr-resource to work with a private repository. Set `repo:full` permissions on the access token you create on GitHub. If it is a public repository, `repo:status` is enough. |
| `v3_endpoint` | No | `https://api.github.com` | Endpoint to use for the V3 Github API (Restful). |
| `v4_endpoint` | No | `https://api.github.com/graphql` | Endpoint to use for the V4 Github API (Graphql). |
| `paths` | No | `terraform/*/*.tf` | Only produce new versions if the PR includes changes to files that match one or more glob patterns or prefixes. |
| `ignore_paths` | No | `.ci/` | Inverse of the above. Pattern syntax is documented in [filepath.Match](https://golang.org/pkg/path/filepath/#Match), or a path prefix can be specified (e.g. `.ci/` will match everything in the `.ci` directory). |
| `paths` | No | `["terraform/*/*.tf"]` | Only produce new versions if the PR includes changes to files that match one or more glob patterns or prefixes. |
| `ignore_paths` | No | `[".ci/"]` | Inverse of the above. Pattern syntax is documented in [filepath.Match](https://golang.org/pkg/path/filepath/#Match), or a path prefix can be specified (e.g. `.ci/` will match everything in the `.ci` directory). |
| `disable_ci_skip` | No | `true` | Disable ability to skip builds with `[ci skip]` and `[skip ci]` in commit message or pull request title. |
| `skip_ssl_verification` | No | `true` | Disable SSL/TLS certificate validation on git and API clients. Use with care! |
| `disable_forks` | No | `true` | Disable triggering of the resource if the pull request's fork repository is different to the configured repository. |
Expand Down Expand Up @@ -69,6 +69,7 @@ generate notifications over the webhook. So if you have a repository with little
| `skip_download` | No | `true` | Use with `get_params` in a `put` step to do nothing on the implicit get. |
| `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. |
| `list_changed_files` | No | `true` | Generate a list of changed files and save alongside metadata |

Clones the base (e.g. `master` branch) at the latest commit, and merges the pull request at the specified commit
Expand All @@ -87,8 +88,7 @@ is available as `.git/resource/base_sha`. For a complete list of available (indi
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 https://github.com/telia-oss/github-pr-resource/issues/32 for more details).

git-crypt encrypted repositories will automatically be decrypted when the `git_crypt_key` is set in the source configuration.
Example here:

```yaml
put: update-status <-- Use an alias for the pull-request resource
Expand All @@ -99,6 +99,8 @@ params:
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
the base, Concourse will reuse the volume (i.e. not trigger a new `get`) if it still exists, which can produce
unexpected results (#5). As such, re-testing a PR against a newer version of the base is best done by *pushing an
Expand Down
3 changes: 0 additions & 3 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
version: '2'

env:
GO111MODULE: on

vars:
BUILD_DIR: build
DOCKER_REPO: teliaoss/github-pr-resource
Expand Down
Loading

0 comments on commit bad7c2b

Please sign in to comment.