Skip to content

Commit

Permalink
🔐 try appending GH_PAT to repo url
Browse files Browse the repository at this point in the history
  • Loading branch information
juanesarango committed Oct 21, 2024
1 parent e1e5515 commit 8cb582f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/run-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Configure credential helper to clone private repos
run: |
echo '#!/bin/bash' > ~/.git-credential-helper.sh
echo 'echo username=${{ secrets.GH_USERNAME }}' >> ~/.git-credential-helper.sh
echo 'echo password=${{ secrets.GH_PAT }}' >> ~/.git-credential-helper.sh
chmod +x ~/.git-credential-helper.sh
git config --global credential.helper "/bin/bash ~/.git-credential-helper.sh"
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand All @@ -42,9 +34,11 @@ jobs:
- name: Install dependencies
run: pip install -r requirements.txt

- name: Run tests
run: bash tests/test-with-compose.sh
env:
GH_PAT: ${{ secrets.GH_PAT }}

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/[email protected]
Expand Down
7 changes: 4 additions & 3 deletions tests/test-with-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ echo "API directory set to: $API_DIR"
echo "CLI directory set to: $CLI_DIR"

# get current isabl branch in case this test depends on a particular branch
ISABL_BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-${TRAVIS_BRANCH:-master}}
echo "ISABL_BRANCH set to $ISABL_BRANCH given travis branch: $TRAVIS_BRANCH $TRAVIS_PULL_REQUEST_BRANCH"
GH_BRANCH=$(echo ${GITHUB_REF#refs/heads/})
ISABL_BRANCH=${GH_BRANCH:-master}
echo "ISABL_BRANCH set to $ISABL_BRANCH given Github branch: $GH_BRANCH"

# clone api from github
rm -rf $API_DIR && git clone https://github.com/papaemmelab/isabl_api.git $API_DIR
rm -rf $API_DIR && git clone https://${GH_PAT}@github.com/papaemmelab/isabl_api.git $API_DIR
cd $API_DIR && (git checkout $ISABL_BRANCH || true) && docker-compose build && docker-compose up -d

# give some time to API to start and test Isabl CLI
Expand Down

0 comments on commit 8cb582f

Please sign in to comment.