Skip to content

A Concourse resource type for monitoring GitHub team membership

License

Notifications You must be signed in to change notification settings

alphagov/github-team-membership-concourse-resource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Concourse GitHub Team Membership Resource

Concourse resource for checking changes to GitHub team membership.

This is useful for monitoring the membership of a team. The intended use case for this is to feed into a slack alert to inform us when a member has been added to a team.

Source Configuration

  • auth_user: Required
    The username to authenticate with GitHub.
  • auth_token: Required
    The personal access token for the user named above.
  • org: Required
    The name of the organisation the team belongs to.
  • team: Required
    The name of the GitHub team.

Behaviour

check:

Fetches the current list of team members, calculates a hash of their names, and reports it.

in:

Fetches the current list of team members and writes their login names to file - ./team-members

Will throw an error if the team membership has changed from the version requested. This could happen if members have been added/removed between the check and the get. Re-running should be sufficient.

out: Not implemented


Example Configuration

Resource Type

resource_types:
  - name: github-team-membership
    type: registry-image
    source:
      repository: 753415395406.dkr.ecr.eu-west-2.amazonaws.com/platform-deployer-github-team-membership-concourse-resource
      tag: latest

Resource

resources:
  - name: verify-concourse-admins
    icon: git
    type: github-team-membership
    source:
      auth_user: wynndow
      auth_token: <PERSONAL_ACCESS_TOKEN>
      org: alphagov
      team: verify-tech-team-concourse-admins

Plan

jobs:
  - name: do-thing
    plan:
      - get: verify-concourse-admins
        trigger: true
      - task: do-the-thing
        image: some-base-image
        config:
          platform: linux
          inputs:
            - name: verify-concourse-admins
          run:
            path: bash
            args:
              - -c
              - cat verify-concourse-admins/team-members

Running the tests

Install required dependencies with:

pip install -r requirements-dev.txt

Then from the root of the repo run:

python -m pytest

About

A Concourse resource type for monitoring GitHub team membership

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published