|
4 | 4 | workflow_dispatch: |
5 | 5 | schedule: |
6 | 6 | - cron: 0 5 * * 1-5 # weekdays at 5:00 AM UTC |
| 7 | + pull_request: |
| 8 | + types: [opened, labeled] |
7 | 9 | jobs: |
8 | 10 | update-tests: |
9 | 11 | runs-on: ubuntu-latest |
| 12 | + if: github.event_name != 'pull_request' || (github.event.action == 'labeled' && github.event.label.name == 'update-snapshots') |
10 | 13 | strategy: |
11 | 14 | fail-fast: false |
12 | 15 | matrix: |
|
28 | 31 | - atlas,datafederation,db |
29 | 32 | - atlas,datafederation,privatenetwork |
30 | 33 | - atlas,datafederation,querylimits |
31 | | - - atlas,decrypt |
| 34 | + # - atlas,decrypt # requires live calls to GCP/AWS/Azure |
32 | 35 | # - atlas,deployments,atlasclusters # one assertion connects to DB (needs live mode) |
33 | 36 | # - atlas,deployments,local,auth,deprecated # needs docker to run |
34 | 37 | # - atlas,deployments,local,auth,new # needs docker to run |
|
56 | 59 | - brew |
57 | 60 | - config |
58 | 61 | - iam |
| 62 | + # - atlas,iam # need to add |
59 | 63 | - kubernetes |
60 | 64 | steps: |
61 | 65 | - uses: GitHubSecurityLab/actions-permissions/monitor@v1 |
@@ -165,31 +169,56 @@ jobs: |
165 | 169 | uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 |
166 | 170 | with: |
167 | 171 | paths: e2e-tests.xml |
168 | | - pr: |
| 172 | + commit: |
169 | 173 | runs-on: ubuntu-latest |
170 | | - if: always() |
| 174 | + if: always() && github.event_name == 'pull_request' |
171 | 175 | needs: update-tests |
172 | 176 | steps: |
173 | | - - uses: GitHubSecurityLab/actions-permissions/monitor@v1 |
| 177 | + - name: set Apix Bot token |
| 178 | + id: app-token |
| 179 | + uses: mongodb/apix-action/token@dd1d8b713effb9ac4972a3318b8e2f03b8a6d8ce |
174 | 180 | with: |
175 | | - config: ${{ vars.PERMISSIONS_CONFIG }} |
| 181 | + app-id: ${{ secrets.APIXBOT_APP_ID }} |
| 182 | + private-key: ${{ secrets.APIXBOT_APP_PEM }} |
176 | 183 | - name: Checkout repository |
177 | 184 | uses: actions/checkout@v4 |
178 | 185 | with: |
179 | | - fetch-depth: 0 |
| 186 | + token: ${{ steps.app-token.outputs.token }} |
| 187 | + ref: ${{ github.event.pull_request.head.ref }} |
180 | 188 | - run: rm -rf test/e2e/.snapshots && mkdir -p test/e2e/.snapshots |
181 | 189 | - name: Download artifacts |
182 | 190 | uses: actions/download-artifact@v4.2.1 |
183 | 191 | with: |
184 | 192 | pattern: snapshots_* |
185 | 193 | path: test/e2e/.snapshots |
186 | 194 | merge-multiple: true |
187 | | - - name: Upload artifact |
188 | | - uses: actions/upload-artifact@v4.6.2 |
| 195 | + - name: commit |
| 196 | + run: | |
| 197 | + git config --global user.name "${{ steps.app-token.outputs.user-name }}" |
| 198 | + git config --global user.email "${{ steps.app-token.outputs.user-email }}" |
| 199 | + git add test/e2e/.snapshots |
| 200 | + git commit -m "Update snapshots" |
| 201 | + git push |
| 202 | + - uses: actions-ecosystem/action-remove-labels@v1 |
| 203 | + with: |
| 204 | + github_token: ${{ steps.app-token.outputs.token }} |
| 205 | + labels: update-snapshots |
| 206 | + pr: |
| 207 | + runs-on: ubuntu-latest |
| 208 | + if: always() && github.event_name != 'pull_request' |
| 209 | + needs: update-tests |
| 210 | + steps: |
| 211 | + - name: Checkout repository |
| 212 | + uses: actions/checkout@v4 |
| 213 | + with: |
| 214 | + fetch-depth: 0 |
| 215 | + - run: rm -rf test/e2e/.snapshots && mkdir -p test/e2e/.snapshots |
| 216 | + - name: Download artifacts |
| 217 | + uses: actions/download-artifact@v4.2.1 |
189 | 218 | with: |
190 | | - name: snapshots |
| 219 | + pattern: snapshots_* |
191 | 220 | path: test/e2e/.snapshots |
192 | | - include-hidden-files: true |
| 221 | + merge-multiple: true |
193 | 222 | - name: Find JIRA ticket |
194 | 223 | id: find |
195 | 224 | uses: mongodb/apix-action/find-jira@dd1d8b713effb9ac4972a3318b8e2f03b8a6d8ce |
@@ -250,8 +279,6 @@ jobs: |
250 | 279 | base: master |
251 | 280 | branch: ${{ env.JIRA_KEY }} |
252 | 281 | labels: | |
253 | | - dependencies |
254 | | - go |
255 | 282 | auto_close_jira |
256 | 283 | body: | |
257 | 284 | ## Proposed changes |
|
0 commit comments