|
| 1 | +name: Bump |
| 2 | + |
| 3 | +on: issue_comment |
| 4 | + |
| 5 | +jobs: |
| 6 | + chart-version: |
| 7 | + name: Chart Version |
| 8 | + runs-on: ubuntu-latest |
| 9 | + |
| 10 | + permissions: |
| 11 | + contents: write |
| 12 | + id-token: write |
| 13 | + issues: write |
| 14 | + |
| 15 | + steps: |
| 16 | + - name: Check for command |
| 17 | + id: command |
| 18 | + continue-on-error: true |
| 19 | + uses: xt0rted/slash-command-action@bf51f8f5f4ea3d58abc7eca58f77104182b23e88 # v2 |
| 20 | + with: |
| 21 | + command: bump |
| 22 | + reaction: "true" |
| 23 | + reaction-type: "eyes" |
| 24 | + allow-edits: "false" |
| 25 | + permission-level: write |
| 26 | + |
| 27 | + - uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4 |
| 28 | + if: steps.command.outputs.command-name |
| 29 | + with: |
| 30 | + python-version: 3.7 |
| 31 | + |
| 32 | + - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4 |
| 33 | + if: steps.command.outputs.command-name |
| 34 | + with: |
| 35 | + go-version: ^1 |
| 36 | + |
| 37 | + - name: Setup helm-docs |
| 38 | + if: steps.command.outputs.command-name |
| 39 | + run: go install github.com/norwoodj/helm-docs/cmd/helm-docs@latest |
| 40 | + |
| 41 | + - name: Generate token |
| 42 | + if: steps.command.outputs.command-name |
| 43 | + id: generate_token |
| 44 | + uses: tibdex/github-app-token@v1 |
| 45 | + with: |
| 46 | + app_id: ${{ vars.JANUS_IDP_GITHUB_APP_ID }} |
| 47 | + private_key: ${{ secrets.JANUS_IDP_GITHUB_APP_PRIVATE_KEY }} |
| 48 | + |
| 49 | + - name: Checkout Repository |
| 50 | + if: steps.command.outputs.command-name |
| 51 | + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 |
| 52 | + with: |
| 53 | + token: ${{ steps.generate_token.outputs.token }} |
| 54 | + |
| 55 | + - name: Checkout Pull Request |
| 56 | + if: steps.command.outputs.command-name |
| 57 | + run: hub pr checkout ${{ github.event.issue.number }} |
| 58 | + env: |
| 59 | + GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} |
| 60 | + |
| 61 | + - name: Get version |
| 62 | + if: steps.command.outputs.command-name |
| 63 | + id: get_version |
| 64 | + uses: mikefarah/yq@6609ed76ecb69f9d8254345292d90ea72f641715 # v4.35.1 |
| 65 | + with: |
| 66 | + cmd: yq ".version" charts/backstage/Chart.yaml |
| 67 | + |
| 68 | + - uses: actions-ecosystem/action-bump-semver@34e334551143a5301f38c830e44a22273c6ff5c5 # v1 |
| 69 | + if: steps.command.outputs.command-name |
| 70 | + id: semver |
| 71 | + with: |
| 72 | + current_version: ${{ steps.get_version.outputs.result }} |
| 73 | + level: ${{ steps.command.outputs.command-arguments }} |
| 74 | + |
| 75 | + - name: Bump the version |
| 76 | + if: steps.command.outputs.command-name |
| 77 | + uses: mikefarah/yq@6609ed76ecb69f9d8254345292d90ea72f641715 # v4.35.1 |
| 78 | + with: |
| 79 | + cmd: yq -i '.version = "${{ steps.semver.outputs.new_version }}"' charts/backstage/Chart.yaml |
| 80 | + |
| 81 | + - name: Run pre-commit |
| 82 | + if: steps.command.outputs.command-name |
| 83 | + uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 # renovate: tag=v3.0.0 |
| 84 | + continue-on-error: true |
| 85 | + |
| 86 | + - name: Setup Gitsign |
| 87 | + if: steps.command.outputs.command-name |
| 88 | + uses: chainguard-dev/actions/setup-gitsign@main |
| 89 | + |
| 90 | + - name: Commit pre-commit changes |
| 91 | + if: steps.command.outputs.command-name |
| 92 | + uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a # v4 |
| 93 | + with: |
| 94 | + commit_message: Bump version to ${{ steps.semver.outputs.new_version }} |
| 95 | + commit_options: '-s' |
| 96 | + commit_user_name: Janus IDP |
| 97 | + commit_user_email: 139477802+janus-idp[bot]@users.noreply.github.com |
| 98 | + commit_author: Janus IDP <139477802+janus-idp[bot]@users.noreply.github.com> |
| 99 | + |
0 commit comments