fix: add GITHUB_TOKEN environment variable for docker build process #1198
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: Docker image creation tests | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| workflow_dispatch: | |
| jobs: | |
| unit_test_execution: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Create GitHub App token | |
| id: app | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ vars.GH_APP_ID }} | |
| private-key: ${{ secrets.GH_APP_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| - name: Set GH_TOKEN for all steps | |
| run: echo "GH_TOKEN=${{ steps.app.outputs.token }}" >> $GITHUB_ENV | |
| - name: Configure git with x-access-token | |
| run: git config --global url."https://x-access-token:${{ steps.app.outputs.token }}@github.com/".insteadOf "https://github.com/" | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| token: ${{steps.app.outputs.token}} | |
| - name: Install package dependencies | |
| run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev python3-testresources | |
| - name: Install python requirements | |
| run: python -m pip install -r packaging_automation/requirements.txt | |
| - name: Build and publish docker images tests | |
| run: python -m pytest -q packaging_automation/tests/test_publish_docker.py |