Skip to content

Add E2E test for action #21

Add E2E test for action

Add E2E test for action #21

Workflow file for this run

name: test
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
end-to-end:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
if: >-
github.event_name != 'pull_request' ||
(github.event.pull_request.head.repo.full_name == github.repository &&
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association))
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
include:
- name: E2E w/out policy ID
policy: ""
- name: E2E w/ policy ID
policy: ${{ vars.POLICY_ID }}
steps:
- uses: actions/checkout@v5
- name: Exchange OIDC token for Vercel access token
uses: ./
with:
team: ${{ vars.TURBO_TEAM }}
audience: https://github.com/vercel
policy: ${{ matrix.policy }}
- name: Verify env exported
shell: bash
run: |
set -euo pipefail
if [[ -z "${TURBO_TOKEN:-}" ]]; then
echo "::error::TURBO_TOKEN was not set"
exit 1
fi
if [[ "${TURBO_TEAM:-}" != "${{ vars.TURBO_TEAM }}" ]]; then
echo "::error::TURBO_TEAM mismatch (got '${TURBO_TEAM:-}', expected '${{ vars.TURBO_TEAM }}')"
exit 1
fi
echo "OIDC exchange succeeded and env vars were exported."