test: inject rich into copr-cli #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: COPR secret test (temporary) | |
| # Throwaway workflow: verifies COPR_API_TOKEN authenticates to COPR in a real | |
| # runner, read-only. Delete this file and branch after use. | |
| on: | |
| push: | |
| branches: [tmp/copr-secret-test] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Authenticate to COPR with the secret | |
| env: | |
| COPR_API_TOKEN: ${{ secrets.COPR_API_TOKEN }} | |
| run: | | |
| if [ -z "$COPR_API_TOKEN" ]; then | |
| echo "::error::COPR_API_TOKEN is empty in this run." | |
| exit 1 | |
| fi | |
| mkdir -p ~/.config | |
| printf '%s\n' "$COPR_API_TOKEN" > ~/.config/copr | |
| chmod 600 ~/.config/copr | |
| pipx install copr-cli | |
| # copr-cli imports `rich` but does not always declare it as a dep. | |
| pipx inject copr-cli rich | |
| echo "=== whoami (proves the token authenticates) ===" | |
| copr-cli whoami | |
| echo "=== projects under giswqs (proves geolibre is reachable) ===" | |
| copr-cli list giswqs | |
| echo "COPR authentication with the GitHub secret succeeded." |