diff --git a/.github/workflows/generated.yml b/.github/workflows/generated.yml index 8bd2b51c..5090cd7d 100644 --- a/.github/workflows/generated.yml +++ b/.github/workflows/generated.yml @@ -28,10 +28,27 @@ permissions: contents: read jobs: + check-token: + runs-on: ubuntu-latest + outputs: + token-exists: ${{ steps.token-check.outputs.defined }} + steps: + - name: Check for Token availability + id: token-check + # perform secret check & put boolean result as an output + shell: bash + run: | + if [ "${{ secrets.CODE_GENERATOR_PAT }}" != '' ]; then + echo "defined=true" >> $GITHUB_OUTPUT; + else + echo "defined=false" >> $GITHUB_OUTPUT; + fi + build: - if: ${{ github.event_name == 'pull_request' }} name: build runs-on: ubuntu-latest + needs: [check-token] + if: ${{ github.event_name == 'pull_request' && needs.check-token.outputs.token-exists == 'true' }} permissions: contents: write continue-on-error: true