diff --git a/.github/workflows/bedrock-fork-trigger.yml b/.github/workflows/bedrock-fork-trigger.yml new file mode 100644 index 000000000..582be342b --- /dev/null +++ b/.github/workflows/bedrock-fork-trigger.yml @@ -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 + diff --git a/.github/workflows/bedrock-internal-trigger.yml b/.github/workflows/bedrock-internal-trigger.yml new file mode 100644 index 000000000..2a2fb6683 --- /dev/null +++ b/.github/workflows/bedrock-internal-trigger.yml @@ -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 + diff --git a/.github/workflows/bedrock.yml b/.github/workflows/bedrock.yml index 588f8183b..171fb1ffc 100644 --- a/.github/workflows/bedrock.yml +++ b/.github/workflows/bedrock.yml @@ -1,9 +1,14 @@ 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 @@ -11,7 +16,7 @@ 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 }} jobs: Style_Check: name: "C++ Styler"