|
29 | 29 | description: If true, will skip tests when compiling. Defaults to false. Set to true for repos without tests. |
30 | 30 | type: boolean |
31 | 31 | default: false |
| 32 | + merge_environment: |
| 33 | + description: GitHub Environment to use for accessing the merge token. Leave empty to use the default GITHUB_TOKEN. |
| 34 | + type: string |
| 35 | + default: '' |
32 | 36 |
|
33 | 37 | env: |
34 | 38 | IS_RELEASE: ${{ (inputs.release_type == 'Major' || inputs.release_type == 'Minor' || inputs.release_type == 'Patch') && (github.event.repository.default_branch == github.ref_name ) }} |
|
38 | 42 | release: |
39 | 43 | name: ${{ ((inputs.release_type == 'Major' || inputs.release_type == 'Minor' || inputs.release_type == 'Patch') && (github.event.repository.default_branch == github.ref_name )) && 'Create Release' || 'Publish Pre-release' }} |
40 | 44 | runs-on: ubuntu-latest |
| 45 | + environment: ${{ inputs.merge_environment }} |
41 | 46 | permissions: |
42 | 47 | pull-requests: write |
43 | 48 | contents: write |
@@ -138,19 +143,21 @@ jobs: |
138 | 143 | mvn -B -s settings.xml -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" clean compile -DskipTests |
139 | 144 |
|
140 | 145 | - name: Commit pom.xml and version.json |
141 | | - if: ${{ steps.checkRelease.outputs.is_release != 'true' }} |
142 | | - uses: IABTechLab/uid2-shared-actions/actions/commit_pr_and_merge@v2 |
| 146 | + if: ${{ steps.checkRelease.outputs.is_release != 'true' }} |
| 147 | + uses: IABTechLab/uid2-shared-actions/actions/commit_pr_and_merge@v3 |
143 | 148 | with: |
144 | 149 | add: '${{ inputs.working_dir }}/pom.xml ${{ inputs.working_dir }}/version.json' |
145 | 150 | message: 'Released ${{ inputs.release_type }} version: ${{ steps.version.outputs.new_version }}' |
| 151 | + github_token: ${{ inputs.merge_environment != '' && secrets.GH_MERGE_TOKEN || '' }} |
146 | 152 |
|
147 | 153 | - name: Commit pom.xml, version.json and set tag |
148 | | - if: ${{ steps.checkRelease.outputs.is_release == 'true' }} |
149 | | - uses: IABTechLab/uid2-shared-actions/actions/commit_pr_and_merge@v2 |
| 154 | + if: ${{ steps.checkRelease.outputs.is_release == 'true' }} |
| 155 | + uses: IABTechLab/uid2-shared-actions/actions/commit_pr_and_merge@v3 |
150 | 156 | with: |
151 | 157 | add: '${{ inputs.working_dir }}/pom.xml ${{ inputs.working_dir }}/version.json' |
152 | 158 | message: 'Released ${{ inputs.release_type }} version: ${{ steps.version.outputs.new_version }}' |
153 | | - tag: v${{ steps.version.outputs.new_version }} |
| 159 | + tag: v${{ steps.version.outputs.new_version }} |
| 160 | + github_token: ${{ inputs.merge_environment != '' && secrets.GH_MERGE_TOKEN || '' }} |
154 | 161 |
|
155 | 162 | - name: Build Changelog |
156 | 163 | id: github_release |
|
0 commit comments