From 1070c08d3dbd57a68db88d8d7f1693a0e3eac4ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Tue, 17 Dec 2024 12:20:26 +0100 Subject: [PATCH] fix: unshallow and merge main into extra dirs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When extra-dirs is used we also need to apply main branch into each directory. Signed-off-by: Sébastien Han --- .github/workflows/main.yml | 5 +++-- depends_on_stage2 | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2180f0d..de226e6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,13 +20,13 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Checkout code (2nd) + - name: Checkout code (2nd) - to test extra-dirs option uses: actions/checkout@v4 with: repository: depends-on/depends-on-action path: second - - name: Checkout code (3rd) + - name: Checkout code (3rd) - to test extra-dirs option uses: actions/checkout@v4 with: repository: depends-on/depends-on-action @@ -34,6 +34,7 @@ jobs: - name: Inject dependent Pull Requests uses: ./ + id: inject_deps with: token: ${{ secrets.GITHUB_TOKEN }} extra-dirs: depends-on-action/second depends-on-action/third diff --git a/depends_on_stage2 b/depends_on_stage2 index b3f7a30..bf9483a 100755 --- a/depends_on_stage2 +++ b/depends_on_stage2 @@ -141,6 +141,9 @@ def main(check_mode): real_extra_dirs = [] for extra_dir in data["extra_dirs"]: real_extra_dir = os.path.realpath(extra_dir) + if not check_mode: + unshallow(real_extra_dir, data["main_branch"]) + merge_main_branch(real_extra_dir, data["main_branch"]) if not os.path.isdir(real_extra_dir): log(f"Extra directory {real_extra_dir} does not exist.") return 1