@@ -288,36 +288,22 @@ namespace :github do
288288 'name' => 'upload/junit' ,
289289 'if' => '!cancelled()' ,
290290 'runs-on' => ubuntu ,
291- 'env' => {
292- 'DD_APP_KEY' => '${{ secrets.DD_APP_KEY }}' ,
293- 'DD_API_KEY' => '${{ secrets.DD_API_KEY }}' ,
294- 'DD_ENV' => 'ci' ,
295- 'DATADOG_SITE' => 'datadoghq.com' ,
296- 'DD_SERVICE' => 'dd-trace-rb' ,
291+ 'container' => {
292+ 'image' => 'datadog/ci' ,
293+ 'credentials' => {
294+ 'username' => '${{ secrets.DOCKERHUB_USERNAME }}' ,
295+ 'password' => '${{ secrets.DOCKERHUB_TOKEN }}'
296+ } ,
297+ 'env' => {
298+ 'DD_API_KEY' => '${{ secrets.DD_API_KEY }}' ,
299+ 'DD_ENV' => 'ci' ,
300+ 'DATADOG_SITE' => 'datadoghq.com' ,
301+ 'DD_SERVICE' => 'dd-trace-rb' ,
302+ 'DD_GIT_REPOSITORY_URL' => '${{ github.repositoryUrl }}' ,
303+ }
297304 } ,
298- # 'container' => {
299- # 'image' => 'datadog/ci',
300- # 'credentials' => {
301- # 'username' => '${{ secrets.DOCKERHUB_USERNAME }}',
302- # 'password' => '${{ secrets.DOCKERHUB_TOKEN }}'
303- # },
304- # 'env' => {
305- # 'DD_APP_KEY' => '${{ secrets.DD_APP_KEY }}',
306- # 'DD_API_KEY' => '${{ secrets.DD_API_KEY }}',
307- # 'DD_ENV' => 'ci',
308- # 'DATADOG_SITE' => 'datadoghq.com',
309- # 'DD_SERVICE' => 'dd-trace-rb',
310- # }
311- # },
312305 'needs' => runtimes . map ( &:build_test_id ) ,
313306 'steps' => [
314- { 'uses' => 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' } ,
315- {
316- 'run' => <<~BASH
317- curl -L --fail --retry 5 https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_linux-x64 --output /usr/local/bin/datadog-ci
318- chmod +x /usr/local/bin/datadog-ci
319- BASH
320- } ,
321307 { 'run' => 'mkdir -p tmp/rspec && datadog-ci version' } ,
322308 {
323309 'uses' => 'actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16' ,
@@ -328,7 +314,16 @@ namespace :github do
328314 }
329315 } ,
330316 { 'run' => "sed -i 's;file=\" \. \/ ;file=\" ;g' tmp/rspec/*.xml" } ,
331- { 'run' => 'datadog-ci junit upload --verbose --dry-run tmp/rspec/' } ,
317+ {
318+ 'if' => "github.event_name == 'pull_request'" ,
319+ 'run' => 'echo "DD_GIT_COMMIT_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV'
320+ } ,
321+ {
322+ 'if' => "github.event_name != 'pull_request'" ,
323+ 'run' => 'echo "DD_GIT_COMMIT_SHA=${{ github.sha }}" >> $GITHUB_ENV'
324+ } ,
325+ { 'run' => 'echo $DD_GIT_COMMIT_SHA' } ,
326+ { 'run' => 'datadog-ci junit upload --verbose tmp/rspec/' } ,
332327 ]
333328 } ,
334329 'coverage' => {
0 commit comments