|
26 | 26 | default: none |
27 | 27 | description: | |
28 | 28 | GitHub Actions upgrades to automatically merge. Valid values are: all, none, major, minor, patch. |
| 29 | + gomod: |
| 30 | + required: false |
| 31 | + type: string |
| 32 | + default: none |
| 33 | + description: | |
| 34 | + Go upgrades to automatically merge. Valid values are: all, none, major, minor, patch. |
29 | 35 | npm: |
30 | 36 | required: false |
31 | 37 | type: string |
|
57 | 63 | exit 1 |
58 | 64 | fi |
59 | 65 |
|
| 66 | + echo "gomod=${{ inputs.gomod }}" |
| 67 | + if [[ ! "${{ inputs.gomod }}" =~ ^(all|none|major|minor|patch)$ ]]; then |
| 68 | + echo "Invalid input: gomod=${{ inputs.gomod }}" |
| 69 | + exit 1 |
| 70 | + fi |
| 71 | +
|
60 | 72 | echo "npm=${{ inputs.npm }}" |
61 | 73 | if [[ ! "${{ inputs.npm }}" =~ ^(all|none|major|minor|patch)$ ]]; then |
62 | 74 | echo "Invalid input: npm=${{ inputs.npm }}" |
@@ -130,3 +142,34 @@ jobs: |
130 | 142 | run: | |
131 | 143 | gh pr review --approve --body "Merging this \`${UPDATE_TYPE}\` update (npm: \`${MERGE_ECOSYSTEM}\`, all: \`${MERGE_ALL}\`)" "$PR_URL" |
132 | 144 | gh pr merge --auto --merge "$PR_URL" |
| 145 | +
|
| 146 | + - name: Merge Go update |
| 147 | + if: | |
| 148 | + steps.metadata.outputs.package-ecosystem == 'go_modules' && |
| 149 | + ( |
| 150 | + (inputs.all == 'all' || inputs.go_modules == 'all') || |
| 151 | + ( |
| 152 | + steps.metadata.outputs.update-type == 'version-update:semver-major' && |
| 153 | + (inputs.all == 'major' || inputs.go_modules == 'major') |
| 154 | + ) || |
| 155 | + ( |
| 156 | + steps.metadata.outputs.update-type == 'version-update:semver-minor' && |
| 157 | + ( |
| 158 | + (inputs.all == 'major' || inputs.go_modules == 'major') || |
| 159 | + (inputs.all == 'minor' || inputs.go_modules == 'minor') |
| 160 | + ) |
| 161 | + ) || |
| 162 | + ( |
| 163 | + steps.metadata.outputs.update-type == 'version-update:semver-patch' && |
| 164 | + (inputs.all != 'none' || inputs.go_modules != 'none') |
| 165 | + ) |
| 166 | + ) |
| 167 | + env: |
| 168 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 169 | + MERGE_ALL: ${{ inputs.all }} |
| 170 | + MERGE_ECOSYSTEM: ${{ inputs.gomod }} |
| 171 | + UPDATE_TYPE: ${{ steps.metadata.outputs.update-type }} |
| 172 | + PR_URL: ${{ github.event.pull_request.html_url }} |
| 173 | + run: | |
| 174 | + gh pr review --approve --body "Merging this \`${UPDATE_TYPE}\` update (gomod: \`${MERGE_ECOSYSTEM}\`, all: \`${MERGE_ALL}\`)" "$PR_URL" |
| 175 | + gh pr merge --auto --merge "$PR_URL" |
0 commit comments