forked from osism/github-manager
-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (46 loc) · 1.46 KB
/
manage-github-repositories.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
name: Manage github repositories
"on":
workflow_dispatch:
push:
branches:
- main
jobs:
manage-github-repositories:
runs-on: ubuntu-latest
steps:
- name: Check token permissions
run: |
if [ -z "${{ secrets[format('GHP_{0}', github.actor)] }}" ]; then
echo "No valid PAT found for ${{github.actor}}"
exit 1
else
echo "Found valid PAT for ${{github.actor}}"
fi
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: true
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pipenv'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install pipenv wheel
pipenv install
- name: Install ansible collection
run: |
ansible-galaxy collection install git+https://github.com/opentelekomcloud/ansible-collection-gitcontrol.git
- name: Manage github repositories with Ansible
run: |
pipenv run ansible-playbook playbook.yaml -e api_token=$API_TOKEN
env:
API_TOKEN: ${{ secrets[format('GHP_{0}', github.actor)] }}
- name: Manage github repositories with Python
run: |
pipenv run python3 manage.py --keep_labels TRUE
env:
API_TOKEN: ${{ secrets[format('GHP_{0}', github.actor)] }}