-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathci-reporting-app-pr-environment-checks.yml
More file actions
35 lines (33 loc) · 1.67 KB
/
ci-reporting-app-pr-environment-checks.yml
File metadata and controls
35 lines (33 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: CI reporting-app PR Environment Checks
on:
workflow_dispatch:
inputs:
pr_number:
required: true
type: string
commit_hash:
required: true
type: string
pull_request:
jobs:
# Fork PRs cannot use id-token/OIDC to AWS; running build + PR env + e2e would always fail.
# Same-repo PR: head branch lives in this repo (matches `gh api repos/.../pulls/N` head.repo.full_name vs base).
update:
name: " " # GitHub UI is noisy when calling reusable workflows, so use whitespace for name to reduce noise
uses: ./.github/workflows/pr-environment-checks.yml
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.state == 'open' && github.event.pull_request.head.repo.full_name == github.repository)
with:
app_name: "reporting-app"
environment: "dev"
pr_number: ${{ inputs.pr_number || github.event.number }}
commit_hash: ${{ inputs.commit_hash || github.event.pull_request.head.sha }}
# Keeps fork PR workflow runs successful with an explicit notice (avoids red e2e/AWS failures).
fork-pr-skip-notice:
name: PR environment / E2E skipped (fork PR)
if: github.event_name == 'pull_request' && github.event.pull_request.state == 'open' && github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- name: Explain skip
run: |
echo "::notice::PR environment update and E2E are skipped for fork PRs (GitHub does not grant OIDC/AWS credentials to workflows from forks)."
echo "Validate after merge to the default branch, or push a branch on the upstream repo for a full run."