Bump braces from 3.0.2 to 3.0.3 #102
Workflow file for this run
This file contains 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
# Run secret-dependent integration tests only after /ok-to-test approval | |
on: | |
pull_request: {} | |
repository_dispatch: | |
types: [ok-to-test-command] | |
name: Integration tests | |
jobs: | |
# Branch-based pull request | |
integration-trusted: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository | |
permissions: | |
id-token: write | |
steps: | |
- name: Branch based PR checkout | |
uses: actions/checkout@v2 | |
- id: integration-test | |
uses: ./.github/actions/integration_tests | |
with: | |
boundary_policy: ${{ secrets.AWS_PERMISSIONS_BOUNDARY_ARN }} | |
env_suffix: ${{ github.event.pull_request.number }} | |
role_to_assume: ${{ secrets.AWS_ROLE_ARN }} | |
# Repo owner has commented /ok-to-test on a (fork-based) pull request | |
integration-fork: | |
runs-on: ubuntu-latest | |
if: | |
github.event_name == 'repository_dispatch' && | |
github.event.client_payload.slash_command.sha != '' && | |
contains(github.event.client_payload.pull_request.head.sha, github.event.client_payload.slash_command.sha) | |
permissions: | |
id-token: write | |
checks: write | |
contents: write | |
steps: | |
# Check out merge commit | |
- name: Fork based /ok-to-test checkout | |
uses: actions/checkout@v2 | |
with: | |
ref: 'refs/pull/${{ github.event.client_payload.pull_request.number }}/merge' | |
- id: integration-test | |
uses: ./.github/actions/integration_tests | |
with: | |
boundary_policy: ${{ secrets.AWS_PERMISSIONS_BOUNDARY_ARN }} | |
env_suffix: ${{ github.event.client_payload.pull_request.number }} | |
role_to_assume: ${{ secrets.AWS_ROLE_ARN }} | |
# Update check run called "integration-fork" | |
- uses: actions/github-script@v1 | |
id: update-check-run | |
if: ${{ always() }} | |
env: | |
number: ${{ github.event.client_payload.pull_request.number }} | |
job: ${{ github.job }} | |
# Conveniently, job.status maps to https://developer.github.com/v3/checks/runs/#update-a-check-run | |
conclusion: ${{ job.status }} | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const { data: pull } = await github.pulls.get({ | |
...context.repo, | |
pull_number: process.env.number | |
}); | |
const ref = pull.head.sha; | |
const { data: checks } = await github.checks.listForRef({ | |
...context.repo, | |
ref | |
}); | |
const check = checks.check_runs.filter(c => c.name === process.env.job); | |
const { data: result } = await github.checks.update({ | |
...context.repo, | |
check_run_id: check[0].id, | |
status: 'completed', | |
conclusion: process.env.conclusion | |
}); | |
return result; |