Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/bedrock-fork-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This is for all external BE contributors' test runs.
# The goal is so that they cannot explicitly push changes to the workflow to print
# sensitive information.
name: Forked Test Suite
on:
pull_request:
types: [opened, synchronize]
branches-ignore: [production]
jobs:
Automated-Tests:
name: Automated Tests
# This shows that its a fork
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
uses: ./.github/workflows/bedrock.yml
with:
is_fork: true
secrets: inherit

15 changes: 15 additions & 0 deletions .github/workflows/bedrock-internal-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This is for all internal employees' test runs.
# The goal is so that we can modify and change workflows without merging to main.
name: Internal Suite
on:
push:
branches: # this ignores tag pushes, and only looks at branches.
- '**'
release:
types: [prereleased, published]
jobs:
Automated-Tests:
name: Automated Tests
uses: ./.github/workflows/bedrock.yml
secrets: inherit

15 changes: 10 additions & 5 deletions .github/workflows/bedrock.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
name: Bedrock Test Suite
on:
pull_request:
types: [opened, synchronize]
release:
types: [prereleased, published]
workflow_call:
inputs:
# We treat forks differently since any styler that checks the diff to find files to check MUST first process the
# fork as a branch, then it can work with it.
is_fork:
description: 'Is this PR coming from a forked repository?'
default: false
required: false
type: boolean
concurrency:
group: "${{ github.ref }}"
cancel-in-progress: true
env:
CCACHE_BASEDIR: "/home/runner/.cache/ccache"
# Use mirror.bastion1.sjc if running locally
APT_MIRROR_URL: "apt-mirror.expensify.com:843"
GITHUB_BRANCH: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) && format('pull/{0}/head', github.event.pull_request.number) || github.ref_name }}
GITHUB_BRANCH: ${{ inputs.is_fork && format('pull/{0}/head', github.event.pull_request.number) || github.ref_name }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pass PR number into reusable workflow for forked runs

Because this workflow now runs via workflow_call, the github.event payload is for the workflow_call event, not the original pull_request, so github.event.pull_request.number will be empty when bedrock-fork-trigger.yml calls it. With inputs.is_fork set, that makes GITHUB_BRANCH expand to something like pull//head, which breaks the ci_style.sh fetch/diff logic for forked PRs (invalid refspec). To keep forked style checks working, pass the PR number as an explicit input from the caller or derive it from github.ref instead of github.event.pull_request.

Useful? React with 👍 / 👎.

jobs:
Style_Check:
name: "C++ Styler"
Expand Down