Skip to content

Commit 39a4f30

Browse files
committed
add a dryrun check
Signed-off-by: Marc Schöchlin <[email protected]>
1 parent e6f55b2 commit 39a4f30

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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)] }}

0 commit comments

Comments
 (0)