Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/guillaumefalourd/github-team-members

Github Actions to get / check Github Team Members :octocat:
https://github.com/guillaumefalourd/github-team-members

all-os-supported github-actions github-team

Last synced: 2 days ago
JSON representation

Github Actions to get / check Github Team Members :octocat:

Awesome Lists containing this project

README

        

# GitHub Team Members

[![Security Pipeline](https://github.com/GuillaumeFalourd/github-team-members/actions/workflows/security-pipeline.yml/badge.svg)](https://github.com/GuillaumeFalourd/github-team-members/actions/workflows/security-pipeline.yml) [![Super Linter](https://github.com/GuillaumeFalourd/github-team-members/actions/workflows/super-linter.yml/badge.svg)](https://github.com/GuillaumeFalourd/github-team-members/actions/workflows/super-linter.yml) [![Gitleaks](https://github.com/GuillaumeFalourd/github-team-members/actions/workflows/gitleaks.yml/badge.svg)](https://github.com/GuillaumeFalourd/github-team-members/actions/workflows/gitleaks.yml)

☞ GitHub Actions to get a GitHub Team Members list :octocat:

_Observation: This action can also be used to check if the workflow `${{ github.actor }}` belongs to the specified team._

## 📚 Usage

### ⚠️ Requirements

This action needs a GitHub Token or [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) with the `read:org` permission to read organizational team members.

### Fetch all members from Team Slug

```yaml
- id: get-members
uses: GuillaumeFalourd/github-team-members@v1
with:
org_slug: org-slug
team_slug: team-slug
token: ${{ secrets.GITHUB_TOKEN }}

- run: "echo ${{ steps.get-members.outputs.members }}"
shell: bash
```

### Fetch maintainers from Team Slug

```yaml
- id: get-members
uses: GuillaumeFalourd/github-team-members@v1
with:
org_slug: org-slug
team_slug: team-slug
role: maintainer
token: ${{ secrets.GITHUB_TOKEN }}

- run: "echo ${{ steps.get-members.outputs.members }}"
shell: bash
```

### Check if github.actor belongs to Team Slug

```yaml
- id: get-members
uses: GuillaumeFalourd/github-team-members@v1
with:
org_slug: org-slug
team_slug: team-slug
token: ${{ secrets.GITHUB_TOKEN }}

- if: steps.get-members.outputs.actor-belongs-team == 'true'
run: echo "${{ github.actor }} belongs to Team"
shell: bash

- if: steps.get-members.outputs.actor-belongs-team == 'false'
run: echo "${{ github.actor }} doesn't belong to Team"
shell: bash
```

## ▶️ Action Inputs

Field | Mandatory | Default Value | Observation
------------ | ------------ | ------------- | -------------
**org_slug** | YES | - | Organization's name
_e.g: `my-org`_
**team_slug** | YES | - | Team's Slug
_e.g: `my-team`_
**role** | NO | `all` | Members Role
_e.g: `member`, `maintainer` or `all`_
**token** | NO | `${{ github.token }}` | [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) to read org team.

## ▶️ Action Outputs

Field | Observation
------------ | ------------
**data** | Raw member data from GitHub API
**members** | Team members list
**actor-belongs-team** | If the workflow `${{ github.actor }}` belongs to the team.
_e.g: `true` or `false`_

## 🤝 Contributing

☞ If you're interested in contributing to this repository, please follow the [guidelines](https://github.com/GuillaumeFalourd/github-team-members/blob/main/CONTRIBUTING.md)

## 🏅 Licensed

☞ This repository uses the [Apache License 2.0](https://github.com/GuillaumeFalourd/github-team-members/blob/main/LICENSE)