Skip to content

Commit ef4eb8e

Browse files
DEVOPS-39 added workflow yaml
1 parent c5a2fd8 commit ef4eb8e

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: list-repos-in-organization-based-on-name-and-add-to-github-teams
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
org_name:
6+
description: 'GitHub organization name'
7+
type: string
8+
required: true
9+
github_team_name:
10+
description: 'GithHub team name'
11+
type: string
12+
required: true
13+
search_string:
14+
required: true
15+
description: 'GitHub repo name search string'
16+
type: string
17+
permission:
18+
required: true
19+
description: 'Permissions for Github teams across repository'
20+
type: choice
21+
options:
22+
- admin
23+
- push
24+
- pull
25+
- triage
26+
- maintain
27+
28+
jobs:
29+
list-repos-in-organization-based-on-name-and-add-to-github-teams:
30+
runs-on: ubuntu-latest
31+
env:
32+
GH_TOKEN: ${{ secrets.DEVWITHKRISHNA_PERSONAL_ACCESS_TOKEN }}
33+
steps:
34+
- name: set up python
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: '3.10'
38+
- name: Pipenv venv installation
39+
run: |
40+
pip install pipenv
41+
pipenv install --skip-lock
42+
- name: Execute python program
43+
run: |
44+
pipenv run python3 list_repos_and_add_to_teams.py --org_name ${{ inputs.org_name }} \
45+
--github_team_name ${{ inputs.github_team_name }} --search_string ${{ inputs.search_string }} \
46+
--permission ${{ inputs.permission }}
47+
- name: program execution completed
48+
run: echo "program execution completed"
49+
50+

list_repos_and_add_to_teams.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ def main():
113113
parser.add_argument("--search_string", required=True, type=str, help="github repo name search string")
114114
parser.add_argument("--permission", required=True,choices=['admin', 'push', 'pull', 'triage', 'maintain'], help="Permissions for Github teams across repository" )
115115
args = parser.parse_args()
116+
116117
org_name = args.org_name
118+
117119
github_team_name = args.github_team_name
118120
search_string = args.search_string
119121
permission = args.permission

0 commit comments

Comments
 (0)