Skip to content

Recommend GitHub App token for CI to trigger on upstack PRs #43

Recommend GitHub App token for CI to trigger on upstack PRs

Recommend GitHub App token for CI to trigger on upstack PRs #43

Workflow file for this run

name: Tests
on:
pull_request:
branches: ['*']
jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run unit tests
run: bash tests/test_update_pr_stack.sh
e2e-tests:
name: E2E Tests
runs-on: ubuntu-latest
# Only run if secrets are available (not available on forks)
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: Run e2e tests
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
PRESERVE_ON_FAILURE: "1"
run: |
gh auth setup-git
bash tests/test_e2e.sh