|
1 | | -name: gha-ci-issues |
2 | | -description: Upload JUnit XML report to Mergify CI Insights |
| 1 | +name: gha-mergify-ci |
| 2 | +description: The Mergify CI integration with GitHub Actions |
3 | 3 | author: Mergify |
4 | 4 | branding: |
5 | 5 | icon: at-sign |
6 | 6 | color: blue |
7 | 7 | inputs: |
| 8 | + action: |
| 9 | + description: | |
| 10 | + The Mergify CI action: |
| 11 | + * junit-process: process Junit XML files with Mergify CI Insights (Upload and Quarantine) |
| 12 | + * scopes: detect and upload pull requests scopes to Mergify Merge Queue |
| 13 | + # Backward compat |
| 14 | + default: junit-process |
8 | 15 | token: |
9 | | - required: true |
10 | 16 | description: Mergify CI token |
| 17 | + mergify_api_url: |
| 18 | + description: URL of the Mergify API |
| 19 | + default: https://api.mergify.com |
11 | 20 | job_name: |
12 | 21 | description: | |
13 | 22 | Override the job name, must be used in case of matrix job to avoid |
14 | 23 | having the same name for all jobs |
15 | 24 | report_path: |
16 | | - required: true |
17 | 25 | description: Path of the files to upload |
18 | | - mergify_api_url: |
19 | | - required: false |
20 | | - description: URL of the Mergify API |
21 | | - default: https://api.mergify.com |
22 | 26 | flaky_test_detection: |
23 | | - required: false |
24 | 27 | description: Mark test execution as part of a flaky test detection process |
25 | 28 | default: "false" |
| 29 | +outputs: |
| 30 | + scopes: |
| 31 | + description: stringified JSON mapping with names of all scopes matching any of changed files |
| 32 | + value: ${{ steps.scopes-detection.outputs.scopes }} |
26 | 33 | runs: |
27 | 34 | using: composite |
28 | 35 | steps: |
|
38 | 45 |
|
39 | 46 | - shell: bash |
40 | 47 | id: junit-process |
| 48 | + if: inputs.action == 'junit-process' |
41 | 49 | env: |
42 | 50 | MERGIFY_API_URL: ${{ inputs.mergify_api_url }} |
43 | 51 | MERGIFY_TEST_FLAKY_DETECTION: ${{ inputs.flaky_test_detection }} |
|
47 | 55 | run: | |
48 | 56 | set -x -e |
49 | 57 | mergify ci junit-process ${FILES} |
| 58 | +
|
| 59 | + - name: Detect scopes |
| 60 | + if: inputs.action == 'scopes' |
| 61 | + id: scopes-detection |
| 62 | + shell: bash |
| 63 | + run: mergify ci scopes --write $RUNNER_TEMP/mergify-scopes.json |
| 64 | + |
| 65 | + - name: Upload scopes to Mergify API |
| 66 | + shell: bash |
| 67 | + if: inputs.token && inputs.action == 'scopes' |
| 68 | + env: |
| 69 | + MERGIFY_TOKEN: ${{ inputs.token }} |
| 70 | + MERGIFY_API_URL: ${{ inputs.mergify_api_url }} |
| 71 | + run: mergify ci scopes-send --file $RUNNER_TEMP/mergify-scopes.json |
0 commit comments