Skip to content

Commit

Permalink
Test if setting the project ID manually as an env var works
Browse files Browse the repository at this point in the history
  • Loading branch information
cgmorton committed Feb 12, 2025
1 parent c7fc92f commit 20266fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:
uses: google-github-actions/setup-gcloud@v2
- name: EE token
run: echo "ACTION_EE_TOKEN=$(gcloud auth print-access-token)" >> $GITHUB_ENV
- name: Set Project ID
run: echo "PROJECT_ID=openet" >> $GITHUB_ENV
- name: Test with pytest
run: |
python -m pytest
3 changes: 2 additions & 1 deletion openet/core/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def test_init():
# For GitHub Actions authenticate using workload identify federation
if "ACTION_EE_TOKEN" in os.environ:
creds = google.oauth2.credentials.Credentials(os.getenv('ACTION_EE_TOKEN'))
ee.Initialize(creds, project=creds.project_id)
# ee.Initialize(creds, project=os.getenv('PROJECT_ID'))
# ee.Initialize(creds, project=os.getenv('PROJECT_ID'))
elif 'EE_PRIVATE_KEY_B64' in os.environ:
print('Writing privatekey.json from environmental variable ...')
content = base64.b64decode(os.environ['EE_PRIVATE_KEY_B64']).decode('ascii')
Expand Down

0 comments on commit 20266fd

Please sign in to comment.