|
| 1 | +# SPDX-FileCopyrightText: 2025 DB Systel GmbH |
| 2 | +# |
| 3 | +# SPDX-License-Identifier: Apache-2.0 |
| 4 | + |
| 5 | +name: Test with real GitHub org |
| 6 | + |
| 7 | +on: |
| 8 | + pull_request: |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +jobs: |
| 12 | + selftest: |
| 13 | + runs-on: ubuntu-24.04 |
| 14 | + env: |
| 15 | + GITHUB_APP_ID: ${{ secrets.TEST_GITHUB_APP_ID }} |
| 16 | + GITHUB_APP_PRIVATE_KEY: ${{ secrets.TEST_GITHUB_APP_PRIVATE_KEY }} |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 |
| 19 | + - uses: ./.github/actions/poetrybuild |
| 20 | + - name: Replace data in config files |
| 21 | + run: | |
| 22 | + sed -i "s/TEST_GITHUB_ORG/${{ secrets.TEST_GITHUB_ORG }}/g" tests/data/config/org_files/*.yaml |
| 23 | + sed -i "s/TEST_USER/${{ secrets.TEST_USER }}/g" tests/data/config/org_files/*.yaml |
| 24 | + sed -i "s/TEST_USER/${{ secrets.TEST_USER }}/g" tests/data/config/teams_files/*.yaml |
| 25 | + - name: Prepare for first run |
| 26 | + run: | |
| 27 | + mkdir -p tests/data/config/teams |
| 28 | + cp tests/data/config/teams_files/teams_changes.yaml tests/data/config/teams/teams.yaml |
| 29 | + cp tests/data/config/org_files/org_changes.yaml tests/data/config/org.yaml |
| 30 | + - name: Run 1 (changes) - dry run |
| 31 | + run: poetry run gh-org-mgr sync -c tests/data/config/ --dry -vv |
| 32 | + - name: Run 1 (changes) - prod run |
| 33 | + run: poetry run gh-org-mgr sync -c tests/data/config/ -vv |
| 34 | + - name: Prepare for second run, reverting to original state |
| 35 | + run: | |
| 36 | + cp tests/data/config/teams_files/teams_orig.yaml tests/data/config/teams/teams.yaml |
| 37 | + cp tests/data/config/org_files/org_orig.yaml tests/data/config/org.yaml |
| 38 | + - name: Run 2 (revert) - dry run |
| 39 | + run: poetry run gh-org-mgr sync -c tests/data/config/ --dry -vv |
| 40 | + - name: Run 2 (revert) - prod run |
| 41 | + run: poetry run gh-org-mgr sync -c tests/data/config/ -vv |
0 commit comments