Skip to content

Add e2e tests + fixes for them #32

Add e2e tests + fixes for them

Add e2e tests + fixes for them #32

name: Run Speakeasy on PR
permissions:
contents: write
pull-requests: write
on:
workflow_dispatch:
pull_request:
paths:
- .speakeasy/in.openapi.yaml
jobs:
run-speakeasy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Speakeasy
uses: speakeasy-api/sdk-generation-action@v15
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
speakeasy_version: latest
- name: Run Speakeasy
run: speakeasy run
- name: Validate SDK
uses: ./.github/actions/validate-sdk
- name: Commit changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "chore: run speakeasy and update generated files"
git push
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}