|
| 1 | +# Request a deployment to the test pipeline |
| 2 | + |
| 3 | +name: request-cli-integ-test |
| 4 | +on: |
| 5 | + pull_request_target: {} |
| 6 | + |
| 7 | +jobs: |
| 8 | + cli-changes: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + outputs: |
| 11 | + any-changed-files: ${{ steps.changed-cli-files.outputs.cli_any_changed }} |
| 12 | + steps: |
| 13 | + - name: Checkout |
| 14 | + uses: actions/checkout@v3 |
| 15 | + with: |
| 16 | + ref: ${{ github.event.pull_request.head.ref }} |
| 17 | + repository: ${{ github.event.pull_request.head.repo.full_name }} |
| 18 | + fetch-depth: 0 |
| 19 | + persist-credentials: false |
| 20 | + - name: Find changed cli files |
| 21 | + id: changed-cli-files |
| 22 | + uses: tj-actions/changed-files@v37 |
| 23 | + with: |
| 24 | + files_yaml: | |
| 25 | + cli: |
| 26 | + - packages/aws-cdk/bin/** |
| 27 | + - packages/aws-cdk/lib/** |
| 28 | + - packages/aws-cdk/test/** |
| 29 | + submit-to-test-pipeline: |
| 30 | + environment: test-pipeline |
| 31 | + needs: cli-changes |
| 32 | + if: needs.cli-changes.outputs.any-changed-files == 'true' |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - name: Checkout |
| 36 | + uses: actions/checkout@v3 |
| 37 | + with: |
| 38 | + ref: ${{ github.event.pull_request.head.ref }} |
| 39 | + repository: ${{ github.event.pull_request.head.repo.full_name }} |
| 40 | + - name: Submit to test-pipeline |
| 41 | + # Needs to run with PROJEN_GITHUB_TOKEN because we need permissions to force push the branch |
| 42 | + run: | |
| 43 | + git config --global user.name 'aws-cdk-automation' |
| 44 | + git config --global user.email '[email protected]' |
| 45 | + git push --force --atomic https://oauth2:${{ secrets.PROJEN_GITHUB_TOKEN }}@github.com/${{ github.repository }}.git FETCH_HEAD:test-main-pipeline |
| 46 | + - name: Explain next steps |
| 47 | + uses: thollander/actions-comment-pull-request@v2 |
| 48 | + with: |
| 49 | + message: | |
| 50 | + :arrow_right: **PR build request submitted to `test-main-pipeline`** :arrow_left: |
| 51 | +
|
| 52 | + A maintainer must now manually check the pipeline and add the `pr-linter/cli-integ-tested` label once the pipeline succeeds. |
| 53 | + comment_tag: request-cli-integ-test |
| 54 | + mode: recreate |
| 55 | + # Post as our automation user |
| 56 | + GITHUB_TOKEN: ${{ secrets.PROJEN_GITHUB_TOKEN }} |
0 commit comments