File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed
Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ name : Manage github repositories
3+
4+ " on " :
5+ workflow_dispatch :
6+ pull_request :
7+ branches-ignore :
8+ - main
9+
10+ jobs :
11+ manage-github-repositories :
12+ runs-on : ubuntu-latest
13+ steps :
14+ - name : Check token permissions
15+ run : |
16+ if [ -z "${{ secrets[format('GHP_{0}', github.actor)] }}" ]; then
17+ echo "No valid PAT found for ${{github.actor}}"
18+ exit 1
19+ else
20+ echo "Found valid PAT for ${{github.actor}}"
21+ fi
22+
23+ - name : Checkout repo
24+ uses : actions/checkout@v3
25+ with :
26+ submodules : true
27+
28+ - name : Setup python
29+ uses : actions/setup-python@v4
30+ with :
31+ python-version : ' 3.10'
32+ cache : ' pipenv'
33+
34+ - name : Install dependencies
35+ run : |
36+ python3 -m pip install --upgrade pip
37+ python3 -m pip install pipenv wheel
38+ pipenv install
39+
40+ - name : Install ansible collection
41+ run : |
42+ ansible-galaxy collection install git+https://github.com/opentelekomcloud/ansible-collection-gitcontrol.git
43+
44+ - name : Manage github repositories with Ansible
45+ run : |
46+ pipenv run ansible-playbook playbook.yaml -e api_token=$API_TOKEN --check
47+ env :
48+ API_TOKEN : ${{ secrets[format('GHP_{0}', github.actor)] }}
49+
50+ # TODO - to be clarified: Whats this?
51+ # - name: Manage github repositories with Python
52+ # run: |
53+ # pipenv run python3 manage.py --keep_labels TRUE
54+ # env:
55+ # API_TOKEN: ${{ secrets[format('GHP_{0}', github.actor)] }}
You can’t perform that action at this time.
0 commit comments