github-org-repos-resource
This resource monitors a github organization for new repositories. The versions are the result of hashing all the repository names. Because this resource is not immutable, it doesn’t truly support getting a specific version. Instead, a get call will disregard the requested version and return the list of all current repositories. Checks function as expected, producing a new version hash if the list of repositories has changed.
Source
api_key :: String
org :: String
Params
None yet
Methods
Check
Reads stdin:
{
"source": {
"api_key": "abc123...",
"org": "LuminalHQ"
},
"version": { "ref": "abc123..." }
}
stdout (can be empty):
[
{ "ref": "abc123..." }
]
In
destination dir as $1 source + version on stdin drops json metadata of repos in dest dir outputs info on stdout:
{
"version": { "ref": "61cebf" },
"metadata": { "info": "no current metadata supported" }
}
Out
Noop
Example pipeline
resource_types:
- name: github-org-repos
type: docker-image
source:
repository: owend/github-org-repos-resource
tag: latest
resources:
- name: repos
webhook_token: ((github-webhook-token))
type: github-org-repos
source:
api_key: ((github-access-token))
org: ((org-name))
check_every: 30m
jobs:
- name: repos-task
plan:
- get: repos
trigger: true
- task: cat-repos
config:
platform: linux
image_resource:
type: docker-image
source:
repository: alpine
tag: latest
inputs:
- name: repos
run:
path: cat
args:
- repos/repos.json