Skip to content

Commit 05a447f

Browse files
committed
Add github auth test
1 parent c26723b commit 05a447f

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.gitlab-ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ include:
77

88
stages:
99
- build
10+
- test_publish
1011
# - shared-pipeline
1112
# - publish
1213
- benchmarks
@@ -828,6 +829,41 @@ trigger_tibco_tests:
828829
# max: 2
829830
# when: always
830831

832+
test_deploy_artifacts_to_github:
833+
stage: test_publish
834+
image: registry.ddbuild.io/images/dd-octo-sts-ci-base:2025.06-1
835+
tags: [ "arch:amd64" ]
836+
837+
id_tokens:
838+
DDOCTOSTS_ID_TOKEN:
839+
aud: dd-octo-sts
840+
841+
rules:
842+
- if: '$POPULATE_CACHE'
843+
when: never
844+
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
845+
when: on_success
846+
847+
needs: []
848+
849+
before_script:
850+
# Get a token
851+
- dd-octo-sts version
852+
- dd-octo-sts debug --scope DataDog/dd-trace-java --policy self.gitlab.release
853+
- dd-octo-sts token --scope DataDog/dd-trace-java --policy self.gitlab.release > github-token.txt
854+
855+
script:
856+
- gh auth login --with-token < github-token.txt
857+
- gh auth status # Maybe helpful to have this output in logs?
858+
859+
after_script:
860+
# Revoke the token after usage
861+
- dd-octo-sts revoke -t $(cat github-token.txt)
862+
863+
retry:
864+
max: 2
865+
when: always
866+
831867
requirements_json_test:
832868
rules:
833869
- when: on_success

0 commit comments

Comments
 (0)