You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 2, 2020. It is now read-only.
- added base_context
- added syntax highlighting to README
- removed obsolete groundcrew section
- added `put` context param to override the source param
- created makefile for ease of development / testing
- bumped `jq` version in makefile
Copy file name to clipboardexpand all lines: README.md
+46-64
Original file line number
Diff line number
Diff line change
@@ -2,25 +2,22 @@
2
2
3
3
A [Concourse](http://concourse.ci/)[resource](http://concourse.ci/resources.html) to interact with the [GitHub Status](https://developer.github.com/v3/repos/statuses/) type.
4
4
5
-
6
5
## Configuration
7
6
8
7
***`repository`** - the owner and repository name, slash delimited (e.g. `dpb587/github-status-resource`)
9
8
***`access_token`** - GitHub API access token from a user with write access to the repository (minimum token scope of `repo:status`)
10
9
*`branch` - the branch currently being monitored (default: `master`)
10
+
*`base_context` - prefix for the context label (default: `concourse-ci`)
11
11
*`context` - a label to differentiate this status from the status of other systems (default: `default`)
12
12
*`endpoint` - GitHub API endpoint (default: `https://api.github.com`)
13
13
*`skip_ssl_verification` - Disable certificate validation for GitHub API calls (default: `false`)
14
14
15
-
16
15
## Behavior
17
16
18
-
19
17
### `check`
20
18
21
19
Triggers when the status of the branch for the configured context has been updated.
22
20
23
-
24
21
### `in`
25
22
26
23
Lookup the state of a status.
@@ -31,7 +28,6 @@ Lookup the state of a status.
31
28
*`/target_url` - the target URL associated with the status
32
29
*`/updated_at` - when the status was last updated
33
30
34
-
35
31
### `out`
36
32
37
33
Update the status of a commit. Optionally include a description and target URL which will be referenced from GitHub.
@@ -43,78 +39,65 @@ Parameters:
43
39
*`description` - a short description of the status
44
40
*`description_path` - path to an input file whose data is the value of `description`
45
41
*`target_url` - the target URL to associate with the status (default: concourse build link)
46
-
42
+
*`context` - overrides the source context value (default: `""`)
47
43
48
44
## Example
49
45
50
46
A typical use case is to update the status of a commit as it traverses your pipeline. The following example marks the commit as pending before unit tests start. Once unit tests finish, the status is updated to either success or failure depending on how the task completes.
51
47
52
-
---
53
-
jobs:
54
-
- name: "unit-tests"
55
-
plan:
56
-
- get: "repo"
57
-
trigger: true
58
-
- put: "repo-status" # +
59
-
params: { state: "pending", commit: "repo" } # +
60
-
- task: "unit-tests"
61
-
file: "repo/ci/unit-tests/task.yml"
62
-
on_failure:
63
-
- put: "repo-status" # +
64
-
params: { state: "failure", commit: "repo" } # +
65
-
- put: "repo-status" # +
66
-
params: { state: "success", commit: "repo" } # +
67
-
resources:
68
-
- name: "repo"
69
-
type: "git"
70
-
source:
71
-
uri: {{repo_uri}}
72
-
branch: {{repo_branch}}
73
-
- name: "repo-status" # +
74
-
type: "github-status" # +
75
-
source: # +
76
-
repository: {{repo_github_path}} # +
77
-
access_token: {{repo_github_token}} # +
48
+
```yaml
49
+
jobs:
50
+
- name: "unit-tests"
51
+
plan:
52
+
- get: "repo"
53
+
trigger: true
54
+
- put: "repo-status"# +
55
+
params: { state: "pending", commit: "repo" } # +
56
+
- task: "unit-tests"
57
+
file: "repo/ci/unit-tests/task.yml"
58
+
on_failure:
59
+
- put: "repo-status"# +
60
+
params: { state: "failure", commit: "repo" } # +
61
+
- put: "repo-status"# +
62
+
params: { state: "success", commit: "repo" } # +
63
+
resources:
64
+
- name: "repo"
65
+
type: "git"
66
+
source:
67
+
uri: {{repo_uri}}
68
+
branch: {{repo_branch}}
69
+
- name: "repo-status"# +
70
+
type: "github-status"# +
71
+
source: # +
72
+
repository: {{repo_github_path}} # +
73
+
access_token: {{repo_github_token}} # +
74
+
```
78
75
79
76
When testing pull requests, use the PR ref as the `branch`. For example, if testing PR #12345 to your repository, your resource might look like...
80
77
81
-
name: "pr-status"
82
-
type: "github-status"
83
-
source:
84
-
repository: {{repo_github_path}}
85
-
access_token: {{repo_github_token}}
86
-
branch: "pull/12345/head" # +
78
+
```yaml
79
+
name: "pr-status"
80
+
type: "github-status"
81
+
source:
82
+
repository: {{repo_github_path}}
83
+
access_token: {{repo_github_token}}
84
+
branch: "pull/12345/head" # +
85
+
```
87
86
88
87
For another pipeline example, see [`ci/pipelines/main.yml`](ci/pipelines/main.yml) which operates against this repository.
89
88
90
-
91
89
## Installation
92
90
93
-
This resource is not included with the standard Concourse release. Use one of the following methods to make this resource available to your pipelines.
94
-
95
-
96
-
### Deployment-wide
97
-
98
-
To install on all Concourse workers, update your deployment manifest properties to include a new `groundcrew.resource_types` entry...
0 commit comments