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
15 changes: 11 additions & 4 deletions .github/workflows/scripts/per-submodule-build-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@
# We'll print some debug information along the way.
echo "Started in working directory '$(pwd)'..."

# Assumption: this script is being run from _inside_ a submodule, but is
# supposed to act on the repo that _contains_ that submodule. Change our working
# directory accordingly.
cd "$(git rev-parse --show-toplevel)/.."
# Move to the repository whose submodules we want to sync. By default this
# script assumes it runs from _inside_ a submodule and acts on the repo that
# directly _contains_ that submodule (one level up). When the submodule is
# nested more than one level deep, the caller can set `SUBMODULE_SYNC_ROOT` to
# the target repository's directory (relative to the checkout root) to act on
# that repository instead.
if [ -n "${SUBMODULE_SYNC_ROOT:-}" ]; then
cd "${GITHUB_WORKSPACE}/${SUBMODULE_SYNC_ROOT}"
else
cd "$(git rev-parse --show-toplevel)/.."
fi

gitmodules_path="$(git rev-parse --show-toplevel)/.gitmodules"
echo "Assumed relevant '.gitmodules' file is '$gitmodules_path'"
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/submodules-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,23 @@ on:
devtools_directory:
required: true
type: string
submodule_sync_root:
description: >-
Directory of the repository whose submodules to sync, relative to
the checkout root. Defaults (empty) to the repository that directly
contains the `dev-tools` submodule. Set it (for example to ".") when
`dev-tools` is nested more than one level deep and the sync should
act on an ancestor repository instead.
required: false
type: string
default: ""
secrets:
private_repo_access_as_rebot_token:
required: true

env:
SCRIPTS_DIRECTORY: ${{ inputs.devtools_directory }}/.github/workflows/scripts
SUBMODULE_SYNC_ROOT: ${{ inputs.submodule_sync_root }}

jobs:
# Since we want to create one PR per each submodule on submodule change
Expand Down
Loading