Skip to content

Commit d2f53d5

Browse files
authored
Merge branch 'main' into feat/cleanup-round-1
2 parents 301e124 + fed34fc commit d2f53d5

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
name: Test the management of github repositories
3+
permissions:
4+
contents: read
5+
6+
"on":
7+
workflow_dispatch:
8+
push:
9+
branches-ignore:
10+
- main
11+
pull_request:
12+
branches-ignore:
13+
- main
14+
15+
jobs:
16+
manage-github-repositories:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Check token permissions
20+
run: |
21+
if [ -z "${{ secrets[format('GHP_{0}', github.actor)] }}" ]; then
22+
echo "No valid PAT found for ${{github.actor}}"
23+
exit 1
24+
else
25+
echo "Found valid PAT for ${{github.actor}}"
26+
fi
27+
28+
- name: Checkout repo
29+
uses: actions/checkout@v3
30+
with:
31+
submodules: true
32+
33+
- name: Setup python
34+
uses: actions/setup-python@v4
35+
with:
36+
python-version: '3.10'
37+
cache: 'pipenv'
38+
39+
- name: Install dependencies
40+
run: |
41+
python3 -m pip install --upgrade pip
42+
python3 -m pip install pipenv wheel
43+
pipenv install
44+
45+
- name: Install ansible collection
46+
run: |
47+
ansible-galaxy collection install git+https://github.com/opentelekomcloud/ansible-collection-gitcontrol.git
48+
49+
- name: Test the management of github repositories with Ansible
50+
run: |
51+
pipenv run ansible-playbook playbook.yaml -e api_token=$API_TOKEN --check --diff
52+
env:
53+
API_TOKEN: ${{ secrets[format('GHP_{0}', github.actor)] }}

0 commit comments

Comments
 (0)