|
| 1 | +name: Update System Tests |
| 2 | + |
| 3 | +on: # yamllint disable-line rule:truthy |
| 4 | + schedule: |
| 5 | + - cron: '0 0 * * 0' # Every Sunday at midnight |
| 6 | + workflow_dispatch: |
| 7 | + inputs: |
| 8 | + ref: |
| 9 | + description: Reference to be updated (commit hash, branch, or tag) |
| 10 | + required: false |
| 11 | + type: string |
| 12 | + dry-run: |
| 13 | + description: Skip PR creation and only show changes |
| 14 | + required: false |
| 15 | + type: boolean |
| 16 | + default: false |
| 17 | + |
| 18 | +concurrency: |
| 19 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 20 | + cancel-in-progress: true |
| 21 | + |
| 22 | +# Default permissions for all jobs |
| 23 | +permissions: {} |
| 24 | + |
| 25 | +jobs: |
| 26 | + update-system-tests: |
| 27 | + name: "Update System Tests" |
| 28 | + runs-on: ubuntu-24.04 |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 31 | + with: |
| 32 | + persist-credentials: true |
| 33 | + |
| 34 | + - name: Checkout System Test |
| 35 | + id: system-test-ref |
| 36 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 37 | + with: |
| 38 | + repository: "DataDog/system-tests" |
| 39 | + path: system-tests |
| 40 | + persist-credentials: false |
| 41 | + ref: ${{ github.event.inputs.ref || '' }} |
| 42 | + |
| 43 | + - run: .github/scripts/update_reference.sh |
| 44 | + env: |
| 45 | + TARGET: ".github/workflows/run-system-tests.yaml" |
| 46 | + PATTERN: '(\s*system-tests.yml@)(\S+)(\s+# Automated:.*)' |
| 47 | + REF: ${{ steps.system-test-ref.outputs.commit }} |
| 48 | + |
| 49 | + - run: git diff --color=always |
| 50 | + |
| 51 | + - name: Create Pull Request |
| 52 | + if: ${{ github.event.inputs.dry-run != true }} |
| 53 | + id: cpr |
| 54 | + uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 |
| 55 | + with: |
| 56 | + branch: auto-generate/update-system-tests |
| 57 | + title: '[🤖] Update System Tests' |
| 58 | + base: master |
| 59 | + commit-message: "[🤖] Update System Tests: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" |
| 60 | + sign-commits: true |
| 61 | + delete-branch: true |
| 62 | + add-paths: | |
| 63 | + .github/ |
| 64 | + body: | |
| 65 | + _This is an auto-generated PR from [here](${{ github.server_url }}/${{ github.repository }}/blob/master/.github/workflows/update-system-tests.yml)_ |
| 66 | + The PR updates the system tests (Updated to commit: ${{ steps.system-test-ref.outputs.commit }}) |
| 67 | + Please review the changes and merge when ready |
0 commit comments