You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dev is the default branch in these 100 repos i'm trying to modify, but i'm trying to modify things in the qal branch for all of them. The search runs fine, but i'm not able to do a git checkout qal, i get an error about not matching any files, and i have tried the checkout step in the should_migrate, post_checkout, and even apply script. Here is my current config file:
id: 2022.04.22-cug01-init
title: create cug01 directories in qal branch of non-prod repos
adapter:
type: github
search_type: repositories
search_query: org:ncr-digital-banking dbk-liftandshift in:name -non-prod in:name
hooks:
should_migrate:
- git fetch --all
- git show-ref
- git branch
- git checkout qal
post_checkout: ls -d wug02/
apply:
- $SHEPHERD_MIGRATION_DIR/cug01.sh
pr_message: echo 'Adding cug01 files to repo'
and here is my apply script:
#!/bin/bash
set -ex
git show-ref
git remote -v
git checkout refs/remotes/origin/qal
git fetch --all
pwd
mkdir -p cug01/qal1
ls -la
ls -la wug02
cd wug02/qal1
tar -cvf env.tar .
mv env.tar ../../cug01/qal1/
cd ../../cug01/qal1/
tar -xvf env.tar
And here is the error during checkout (same happens during apply):
✔ Checked out repo
> Running should_migrate steps
$ git fetch --all
Fetching origin
Step "git fetch --all" exited with 0
$ git show-ref
e9a3b8f3f8ecc0f5b00f77d16eee8269e5a25d51 refs/heads/2022.04.22-cug01-init
e9a3b8f3f8ecc0f5b00f77d16eee8269e5a25d51 refs/heads/dev
e9a3b8f3f8ecc0f5b00f77d16eee8269e5a25d51 refs/remotes/origin/HEAD
e9a3b8f3f8ecc0f5b00f77d16eee8269e5a25d51 refs/remotes/origin/dev
Step "git show-ref" exited with 0
$ git branch
* 2022.04.22-cug01-init
dev
Step "git branch" exited with 0
$ git checkout qal
error: pathspec 'qal' did not match any file(s) known to git
Step "git checkout qal" exited with 1
✖ Error running should_migrate steps; skipping
✖ Error running should_migrate steps; skipping
Some of the previous issues and PRs mention non-default branches, but in looking at the adapter code, there's clearly references to defaultBranch everywhere with no clear way to override it.
Any help is appreciated!
The text was updated successfully, but these errors were encountered:
I briefly thought i was able to "trick" shephard by using id: qal and it said that it checked out the qal branch, but when i checked, it had still checked out the default of dev...
Shepherd doesn't currently support this. Even if you manage to check out a different branch during the apply phase, none of the other commands will know about that and this won't work correctly.
Can you say a little more about why you're trying to work this way? This might be a reasonable ask, and in that case you'd be welcome to submit a PR for this!
dev is the default branch in these 100 repos i'm trying to modify, but i'm trying to modify things in the qal branch for all of them. The search runs fine, but i'm not able to do a
git checkout qal
, i get an error about not matching any files, and i have tried the checkout step in theshould_migrate
,post_checkout
, and evenapply
script. Here is my current config file:and here is my apply script:
And here is the error during checkout (same happens during apply):
Some of the previous issues and PRs mention non-default branches, but in looking at the adapter code, there's clearly references to
defaultBranch
everywhere with no clear way to override it.Any help is appreciated!
The text was updated successfully, but these errors were encountered: