Skip to content

Commit

Permalink
fix other org
Browse files Browse the repository at this point in the history
  • Loading branch information
ipince committed Aug 13, 2024
1 parent 6659736 commit 54756f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
# if you relocate a subdirectory within the monorepo, you need to update this
# yaml for things to continue to work.
targets: >
action-publish-code:test-repo
action-publish-code:jetify-examples/test-repo
# envsec:envsec2
# nixtest:anotherorg/nixtest
# pkg
Expand Down
10 changes: 5 additions & 5 deletions action-publish-code/publish-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ shift
function parse_target() {
# Valid target examples: dir1, dir2:repo2, dir3:org2/repo3
if [[ "$1" =~ ^([^:]+)(:([^/]+/)?([^/]+))?$ ]]; then
dir="${BASH_REMATCH[1]}" # Captures <dir>
target_org="${BASH_REMATCH[3]}" # Captures <owner>/ (with trailing / if present)
target_repo="${BASH_REMATCH[4]}" # Captures <name>
dir="${BASH_REMATCH[1]}"
target_org="${BASH_REMATCH[3]}"
target_repo="${BASH_REMATCH[4]}"

if [ -z "$target_repo" ]; then
target_repo="$dir"
fi

# Remove trailing slash from owner if it's present
target_org="${target_org%/}"
target_org="${target_org%/}" # remove trailing slash if present
if [ -z "$target_org" ]; then
target_org="$org"
fi

echo "$dir $target_org $target_repo"
else
echo "error: invalid target argument: $1"
exit 1
fi
}

Expand Down

0 comments on commit 54756f5

Please sign in to comment.