Sign inSign up

troykinsella/concourse-github-commit-status

By troykinsella

Updated over 6 years ago

A Concourse resource to post GitHub PR commit statuses

Image
0

956

troykinsella/concourse-github-commit-status repository overview

concourse-github-commit-status

A Concourse CI resource that creates a GitHub PR commit status using the GitHub status API.

Normally, one will likely want to use telia-oss/github-pr-resource, but this resource is useful when only setting the commit status without the get behaviour that telia-oss/github-pr-resource provides.

This resource implements the put operation only, and can accept a git repository clone (from the git resource) as a parameter. An example use case for this may be that a pipeline is generated for each branch in a git repository. In one of these branch-specific pipelines, a tests job is triggered upon changes to a git resource, and when the testing steps complete, submit a commit status to GitHub using this resource. In the scenario, the interleaved versions for any PR within a repository that telia-oss/github-pr-resource would produce is unnecessary.

Resource Type Configuration

resource_types:
- name: github-commit-status
  type: docker-image
  source:
    repository: troykinsella/concourse-github-commit-status
    tag: latest

Source Configuration

  • github_token: Required. The GitHub auth token with which to post the commit status.
  • context: Optional. The "context" commit status field. Default: concourse-ci/status.
  • repo_slug: Optional. The GitHub repository slug, i.e. you/your-repo. This is useful when not supplying a git repository clone to the put repo parameter, but instead generating a .git/ref file containing the commit sha using a task script, for example. When supplying a git repository clone, this value can be detected automatically.
Example
resources:
- name: pr
  type: github-commit-status
  source:
    github_token: ((github_token))
    context: concourse-ci/unit-tests

Behaviour

check: No-Op
in: No-Op
out: Post Commit Status
Parameters
  • repo: Required. The path to a directory having a .git/ref file which contains the git commit sha for which to update the status. This can be a path to a git repository clone, perhaps produced by the git resource. If this path is not a git repository, the repo_slug source attribute must be specified.
  • state: Optional. The commit status state field. One of:
    • error
    • failure
    • pending
    • success (default)
  • description: Optional. The commit status description field. Default: Concourse CI build success.
Example
# Extends example in Source Configuration

jobs:
- name:
  plan:
  - get: code # git resource
  - task: unit tests
    ...
  - put: pr
    params:
      repo: code
      state: success
      description: Unit tests passed

License

MIT © Troy Kinsella

Tag summary

Content type

Image

Digest

Size

12.1 MB

Last updated

over 6 years ago

docker pull troykinsella/concourse-github-commit-status