Skip to content

[SINT-4729] use dd-octo-sts in reusable workflows and test.yml #17396

[SINT-4729] use dd-octo-sts in reusable workflows and test.yml

[SINT-4729] use dd-octo-sts in reusable workflows and test.yml #17396

Workflow file for this run

name: Run Tests
permissions:
contents: read
env:
GIT_AUTHOR_EMAIL: "packages@datadoghq.com"
GIT_AUTHOR_NAME: "ci.datadog-api-spec"
on:
pull_request:
branches:
- master
schedule:
- cron: "0 4 * * *"
concurrency:
group: unit-${{ github.head_ref }}
cancel-in-progress: true
jobs:
pre-commit:

Check failure on line 22 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / Run Tests

Invalid workflow file

The workflow is not valid. .github/workflows/test.yml (Line: 22, Col: 3): Error calling workflow 'DataDog/datadog-api-client-java/.github/workflows/reusable-pre-commit.yml@ea35db4ca8bd3666bf0575e68575f486ca093530'. The nested job 'pre-commit' is requesting 'id-token: write', but is only allowed 'id-token: none'.
if: >
(github.event.pull_request.draft == false &&
!contains(github.event.pull_request.labels.*.name, 'ci/skip') &&
!contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) ||
github.event_name == 'schedule'
uses: ./.github/workflows/reusable-pre-commit.yml
with:
enable-commit-changes: true
javadoc:
if: >
(github.event.pull_request.draft == false &&
!contains(github.event.pull_request.labels.*.name, 'ci/skip') &&
!contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) ||
github.event_name == 'schedule'
uses: ./.github/workflows/reusable-javadoc.yml
shading:
if: >
(github.event.pull_request.draft == false &&
!contains(github.event.pull_request.labels.*.name, 'ci/skip') &&
!contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) ||
github.event_name == 'schedule'
uses: ./.github/workflows/reusable-shading.yml
test:
if: >
(github.event.pull_request.draft == false &&
!contains(github.event.pull_request.labels.*.name, 'ci/skip') &&
!contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) ||
github.event_name == 'schedule'
uses: ./.github/workflows/reusable-java-test.yml
with:
java-versions: '["8", "16", "18", "19"]'
platforms: '["ubuntu-latest"]'
test-script: './run-tests.sh'
secrets:
DD_API_KEY: ${{ secrets.DD_API_KEY }}
examples:
if: >
(github.event.pull_request.draft == false &&
!contains(github.event.pull_request.labels.*.name, 'ci/skip') &&
!contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) ||
github.event_name == 'schedule'
uses: ./.github/workflows/reusable-examples.yml
with:
examples-script: './check-examples.sh'
java-version: '16'
report:
runs-on: ubuntu-latest
if: always() && github.event_name == 'pull_request' && contains(github.event.pull_request.head.ref, 'datadog-api-spec/generated/')
permissions:
id-token: write # Required for dd-octo-sts OIDC token
needs:
- test
- examples
- javadoc
- shading
steps:
- name: Get GitHub token via dd-octo-sts
if: github.event_name == 'pull_request'
id: get_token
uses: DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3
with:
scope: DataDog/datadog-api-spec
policy: datadog-api-client-java.test.post-status
- name: Post status check
uses: DataDog/github-actions/post-status-check@v2
with:
github-token: ${{ steps.get_token.outputs.token }}
repo: datadog-api-spec
status: ${{ (needs.javadoc.result == 'cancelled' || needs.test.result == 'cancelled' || needs.examples.result == 'cancelled' || needs.shading.result == 'cancelled') && 'pending' || (needs.javadoc.result == 'success' && needs.test.result == 'success' && needs.examples.result == 'success' && needs.shading.result == 'success') && 'success' || 'failure' }}
context: master/unit