File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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)] }}
You can’t perform that action at this time.
0 commit comments