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
4 changes: 2 additions & 2 deletions .github/ci3_labels_to_env.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Determines CI mode from labels and environment variables.
# Called by ci3.yml to set CI_MODE and related environment variables.
# Called by ci3.yml and ci3-external.yml to set CI_MODE and related environment variables.
# Outputs environment variables to GITHUB_ENV for use in subsequent steps.
set -euo pipefail

Expand All @@ -23,7 +23,7 @@ function main {
local target_branch
if [ "${GITHUB_EVENT_NAME:-}" == "merge_group" ]; then
target_branch="${MERGE_GROUP_BASE_REF:-}"
elif [ "${GITHUB_EVENT_NAME:-}" == "pull_request" ]; then
elif [ "${GITHUB_EVENT_NAME:-}" == "pull_request" ] || [ "${GITHUB_EVENT_NAME:-}" == "pull_request_target" ]; then
target_branch="${PR_BASE_REF:-}"
else
target_branch="${GITHUB_REF_NAME:-}"
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/ci3-external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ jobs:
fi
GITHUB_TOKEN=${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} gh pr edit ${{ github.event.pull_request.number }} --remove-label "ci-external-once"

- name: Determine CI Mode
env:
MERGE_GROUP_BASE_REF: ${{ github.event.merge_group.base_ref }}
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
GITHUB_REF_NAME: ${{ github.ref_name }}
GITHUB_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
run: ./.github/ci3_labels_to_env.sh ${{ join(github.event.pull_request.labels.*.name, ' ') }}

- name: Run
env:
REF_NAME: repo-fork/${{ github.repository }}/${{ github.head_ref }}
Expand All @@ -78,7 +86,7 @@ jobs:
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
PR_COMMITS: ${{ github.event.pull_request.commits }}
GITHUB_REF_NAME: ${{ github.ref_name }}
run: ./.github/ci3.sh "${{ join(github.event.pull_request.labels.*.name, ',') }}"
run: ./.github/ci3.sh $CI_MODE

- name: Post-Actions
if: always()
Expand Down
Loading