[CONTP-849] Fix loop detection bug and add unit tests for cluster agent leader election #31641
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: "Add reviewers on dependency bot PR" | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| branches: | |
| - main | |
| permissions: {} | |
| jobs: | |
| save-pr: | |
| if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'renovate[bot]' || github.event.pull_request.user.login == 'mend[bot]' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Save PR number for later execution | |
| run: | | |
| mkdir -p ./pr | |
| echo ${{ github.event.number }} > ./pr/NR | |
| - name: Upload PR number | |
| uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
| with: | |
| name: pr | |
| path: pr/ | |
| add_reviewers: | |
| if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'renovate[bot]' || github.event.pull_request.user.login == 'mend[bot]' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # This is required for getting the required OIDC token from GitHub | |
| steps: | |
| - uses: DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3 | |
| id: octo-sts | |
| with: | |
| scope: DataDog/datadog-agent | |
| policy: self.add-reviewer-bot-pr.review-pr | |
| - name: Checkout repository | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| token: ${{ steps.octo-sts.outputs.token }} | |
| - name: Install dda | |
| uses: ./.github/actions/install-dda | |
| with: | |
| features: legacy-tasks | |
| - name: Add reviewers | |
| env: | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| GITHUB_TOKEN: ${{ steps.octo-sts.outputs.token }} | |
| run: dda inv -- -e issue.add-reviewers -p $PR_NUMBER |