|
8 | 8 | # branches: [ master ]
|
9 | 9 | pull_request:
|
10 | 10 | types: [review_requested, ready_for_review]
|
| 11 | + repository_dispatch: |
| 12 | + types: [test-gmt-master-command] |
11 | 13 | # Schedule daily tests
|
12 | 14 | schedule:
|
13 | 15 | - cron: '0 0 * * *'
|
@@ -36,10 +38,31 @@ jobs:
|
36 | 38 | # Checkout current git repository
|
37 | 39 | - name: Checkout
|
38 | 40 |
|
| 41 | + if: github.event_name != 'repository_dispatch' |
39 | 42 | with:
|
40 | 43 | # fecth all history so that setuptools-scm works
|
41 | 44 | fetch-depth: 0
|
42 | 45 |
|
| 46 | + # Generate token from GenericMappingTools bot |
| 47 | + - name: Generate token from GenericMappingTools bot |
| 48 | + uses: tibdex/github-app-token@v1 |
| 49 | + if: github.event_name == 'repository_dispatch' |
| 50 | + id: generate-token |
| 51 | + with: |
| 52 | + app_id: ${{ secrets.APP_ID }} |
| 53 | + private_key: ${{ secrets.APP_PRIVATE_KEY }} |
| 54 | + |
| 55 | + # Checkout the pull request branch |
| 56 | + - name: Checkout |
| 57 | + uses: actions/checkout@v2 |
| 58 | + if: github.event_name == 'repository_dispatch' |
| 59 | + with: |
| 60 | + token: ${{ steps.generate-token.outputs.token }} |
| 61 | + repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }} |
| 62 | + ref: ${{ github.event.client_payload.pull_request.head.ref }} |
| 63 | + # fecth all history so that setuptools-scm works |
| 64 | + fetch-depth: 0 |
| 65 | + |
43 | 66 | # Setup Miniconda
|
44 | 67 | - name: Setup Miniconda
|
45 | 68 | uses: conda-incubator/[email protected]
|
@@ -106,3 +129,12 @@ jobs:
|
106 | 129 | with:
|
107 | 130 | name: artifact-GMT-${{ matrix.gmt_git_ref }}-${{ runner.os }}
|
108 | 131 | path: tmp-test-dir-with-unique-name
|
| 132 | + |
| 133 | + - name: Add reaction |
| 134 | + uses: peter-evans/create-or-update-comment@v1 |
| 135 | + if: github.event_name == 'repository_dispatch' |
| 136 | + with: |
| 137 | + token: ${{ steps.generate-token.outputs.token }} |
| 138 | + repository: ${{ github.event.client_payload.github.payload.repository.full_name }} |
| 139 | + comment-id: ${{ github.event.client_payload.github.payload.comment.id }} |
| 140 | + reaction-type: hooray |
0 commit comments