Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:
jobs:
run-tests:
runs-on: ubuntu-latest
env:
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
permissions:
id-token: write # Required to fetch the OIDC token

steps:
- name: Set up Go 1.x
Expand Down Expand Up @@ -40,4 +40,4 @@ jobs:
- name: Report test coverage to DeepSource
run: |
curl https://deepsource.io/cli | sh
./bin/deepsource report --analyzer test-coverage --key go --value-file ./coverage.out
./bin/deepsource report --analyzer test-coverage --key go --value-file ./coverage.out --use-oidc
3 changes: 3 additions & 0 deletions utils/fetch_oidc_token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ func TestGetDSNFromOIDC(t *testing.T) {
t.Setenv("GITHUB_ACTIONS", "true")
// ACTIONS_ID_TOKEN_REQUEST_TOKEN is missing
t.Setenv("ACTIONS_ID_TOKEN_REQUEST_URL", "url")
// make sure this is missing when running on github actions too
os.Unsetenv("ACTIONS_ID_TOKEN_REQUEST_TOKEN")
t.Cleanup(func() {
os.Unsetenv("GITHUB_ACTIONS")
os.Unsetenv("ACTIONS_ID_TOKEN_REQUEST_URL")
Expand All @@ -300,6 +302,7 @@ func TestGetDSNFromOIDC(t *testing.T) {
t.Run("error_github_actions_env_vars_missing_url", func(t *testing.T) {
t.Setenv("GITHUB_ACTIONS", "true")
t.Setenv("ACTIONS_ID_TOKEN_REQUEST_TOKEN", "token")
os.Unsetenv("ACTIONS_ID_TOKEN_REQUEST_URL")
// ACTIONS_ID_TOKEN_REQUEST_URL is missing
t.Cleanup(func() {
os.Unsetenv("GITHUB_ACTIONS")
Expand Down