|
18 | 18 | target: "${{ github.event.inputs.target }}"
|
19 | 19 | version: "${{ github.event.inputs.version }}"
|
20 | 20 | secrets: "inherit"
|
| 21 | + |
| 22 | + module_release_prep: |
| 23 | + needs: gem_release_prep |
| 24 | + runs-on: "ubuntu-latest" |
| 25 | + |
| 26 | + steps: |
| 27 | + |
| 28 | + - name: "Checkout" |
| 29 | + uses: "actions/checkout@v3" |
| 30 | + with: |
| 31 | + fetch-depth: 0 |
| 32 | + |
| 33 | + - name: "Update metadata.json" |
| 34 | + run: | |
| 35 | + current_version=$(jq --raw-output .version metadata.json) |
| 36 | + # Update version in metadata.json, only matching first occurrence |
| 37 | + sed -i "0,/$current_version/s//${{ github.event.inputs.version }}/" $(find . -name 'metadata.json') |
| 38 | +
|
| 39 | + - name: "Get version" |
| 40 | + id: "get_version" |
| 41 | + run: | |
| 42 | + echo "version=$(jq --raw-output .version metadata.json)" >> $GITHUB_OUTPUT |
| 43 | +
|
| 44 | + - name: "Commit changes" |
| 45 | + run: | |
| 46 | + git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com" |
| 47 | + git config --local user.name "GitHub Actions" |
| 48 | + git add . |
| 49 | + git commit -m "Module Release prep v${{ steps.get_version.outputs.version }}" |
| 50 | +
|
| 51 | + - name: "Create pull Request" |
| 52 | + uses: "peter-evans/create-pull-request@v5" |
| 53 | + with: |
| 54 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 55 | + commit-message: "Module Release prep v${{ steps.get_version.outputs.version }}" |
| 56 | + branch: "release-prep" |
| 57 | + delete-branch: true |
| 58 | + title: "Release prep v${{ steps.get_version.outputs.version }}" |
| 59 | + base: "main" |
| 60 | + body: | |
| 61 | + Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb) from commit ${{ github.sha }}. |
| 62 | + Please verify before merging: |
| 63 | + - [ ] last [nightly](https://github.com/${{ github.repository }}/actions/workflows/nightly.yml) run is green |
| 64 | + - [ ] [Changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) is readable and has no unlabeled pull requests |
| 65 | + - [ ] Ensure the [changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) version and [metadata](https://github.com/${{ github.repository }}/blob/release-prep/metadata.json) version match |
| 66 | + labels: "maintenance" |
0 commit comments