Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a dryrun check #300

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/dryrun-manage-github-repositories.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: Test the management of github repositories

"on":
workflow_dispatch:
push:
branches-ignore:
- main
pull_request:
branches-ignore:
- 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: Test the management of github repositories with Ansible
run: |
pipenv run ansible-playbook playbook.yaml -e api_token=$API_TOKEN --check --diff
env:
API_TOKEN: ${{ secrets[format('GHP_{0}', github.actor)] }}
Loading