File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99jobs :
1010 run-tests :
1111 runs-on : ubuntu-latest
12- env :
13- DEEPSOURCE_DSN : ${{ secrets.DEEPSOURCE_DSN }}
12+ permissions :
13+ id-token : write # Required to fetch the OIDC token
1414
1515 steps :
1616 - name : Set up Go 1.x
4040 - name : Report test coverage to DeepSource
4141 run : |
4242 curl https://deepsource.io/cli | sh
43- ./bin/deepsource report --analyzer test-coverage --key go --value-file ./coverage.out
43+ ./bin/deepsource report --analyzer test-coverage --key go --value-file ./coverage.out --use-oidc
Original file line number Diff line number Diff line change @@ -284,6 +284,8 @@ func TestGetDSNFromOIDC(t *testing.T) {
284284 t .Setenv ("GITHUB_ACTIONS" , "true" )
285285 // ACTIONS_ID_TOKEN_REQUEST_TOKEN is missing
286286 t .Setenv ("ACTIONS_ID_TOKEN_REQUEST_URL" , "url" )
287+ // make sure this is missing when running on github actions too
288+ os .Unsetenv ("ACTIONS_ID_TOKEN_REQUEST_TOKEN" )
287289 t .Cleanup (func () {
288290 os .Unsetenv ("GITHUB_ACTIONS" )
289291 os .Unsetenv ("ACTIONS_ID_TOKEN_REQUEST_URL" )
@@ -300,6 +302,7 @@ func TestGetDSNFromOIDC(t *testing.T) {
300302 t .Run ("error_github_actions_env_vars_missing_url" , func (t * testing.T ) {
301303 t .Setenv ("GITHUB_ACTIONS" , "true" )
302304 t .Setenv ("ACTIONS_ID_TOKEN_REQUEST_TOKEN" , "token" )
305+ os .Unsetenv ("ACTIONS_ID_TOKEN_REQUEST_URL" )
303306 // ACTIONS_ID_TOKEN_REQUEST_URL is missing
304307 t .Cleanup (func () {
305308 os .Unsetenv ("GITHUB_ACTIONS" )
You can’t perform that action at this time.
0 commit comments