Skip to content

Commit

Permalink
fix: unshallow and merge main into extra dirs
Browse files Browse the repository at this point in the history
When extra-dirs is used we also need to apply main branch into each
directory.

Signed-off-by: Sébastien Han <[email protected]>
  • Loading branch information
leseb committed Dec 17, 2024
1 parent 7bd82c3 commit 1070c08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,21 @@ 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
path: third

- name: Inject dependent Pull Requests
uses: ./
id: inject_deps
with:
token: ${{ secrets.GITHUB_TOKEN }}
extra-dirs: depends-on-action/second depends-on-action/third
Expand Down
3 changes: 3 additions & 0 deletions depends_on_stage2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1070c08

Please sign in to comment.