Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ inputs:
token:
description: "A Github personal authentication token"
required: true
yamlpath:
description: "Path to the teams.yaml file (if missing, assume it's in repo root)"
Comment thread
drammock marked this conversation as resolved.
Outdated
required: false
Comment thread
drammock marked this conversation as resolved.

runs:
using: "composite"
Expand All @@ -16,7 +19,8 @@ runs:
- name: Sync teams
env:
GH_TOKEN: ${{ inputs.token }}
YAML_PATH: ${{ inputs.yamlpath }}
shell: bash
run: >-
python -m pip install pyyaml requests;
python ${{ github.action_path }}/sync-teams-to-gh.py -o ${{ github.repository_owner }} -m >> $GITHUB_STEP_SUMMARY
python ${{ github.action_path }}/sync-teams-to-gh.py -o ${{ github.repository_owner }} -p ${YAML_PATH:=teams.yaml} -m >> $GITHUB_STEP_SUMMARY
Comment thread
drammock marked this conversation as resolved.
Outdated
5 changes: 4 additions & 1 deletion sync-teams-to-gh.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
parser.add_argument(
"-m", "--markdown", action="store_true", help="Print output in Markdown format"
)
parser.add_argument("-p", "--path", help="path to the teams.yaml file")
Comment thread
drammock marked this conversation as resolved.
Outdated
parser.add_argument("-o", "--org", type=str, required=True)

args = parser.parse_args()
Expand Down Expand Up @@ -179,7 +180,9 @@ def http_method(url, data={}, method=None, fail_ok=False):
sys.exit()


config = yaml.load(open("teams.yaml"), Loader=yaml.SafeLoader)
path = args.path or "teams.yaml"

config = yaml.load(open(path), Loader=yaml.SafeLoader)
config = {team["name"]: team for team in config}


Expand Down
Loading