Skip to content

Commit

Permalink
Merge pull request #24 from maxisoft/dev
Browse files Browse the repository at this point in the history
Implement case-insensitive check for private repositories (improved)
  • Loading branch information
maxisoft authored Jul 28, 2024
2 parents 4755bc7 + 7292556 commit 1bc3c88
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/doit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,18 @@ jobs:
run: |
mkdir tmpgit
EXIT_CODE=0
git clone -q --sparse --depth 1 https://github.com/${{ env.DESTINATION_REPOSITORY_USERNAME }}/${{ env.DESTINATION_REPOSITORY_NAME }}.git tmpgit 2>&1 || {
if (grep --ignore-case -q "could not read Username"); then
git clone -q --sparse --depth 1 'https://github.com/${{ env.DESTINATION_REPOSITORY_USERNAME }}/${{ env.DESTINATION_REPOSITORY_NAME }}.git' &> tmp_git.out 2>&1 || {
if (grep --ignore-case -q "could not read Username" tmp_git.out); then
echo "Repository is private (1)"
EXIT_CODE=$?
else
if (grep --ignore-case -q "Authentication failed" tmp_git.out); then
echo "Repository is private (2)"
EXIT_CODE=$?
fi
fi
}
rm -rf tmp_git.out
if [[ $EXIT_CODE -eq 128 ]]; then
echo "Repository is private"
Expand All @@ -211,6 +218,7 @@ jobs:
GIT_CONFIG_SYSTEM: ''
GIT_CONFIG_GLOBAL: ''
GIT_CONFIG_LOCAL: ''
GIT_TERMINAL_PROMPT: 0

- name: Push kernels directory to another repository
uses: cpina/[email protected]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -786,3 +786,4 @@ fabric.properties
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

/test.sh

0 comments on commit 1bc3c88

Please sign in to comment.