refactor!: rename version input names #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Promote | ||
| on: | ||
| workflow_call: | ||
| secrets: | ||
| checkout-token: | ||
| description: 'Checkout token with repo permissions' | ||
| required: false | ||
| inputs: | ||
| git-user-name: | ||
| description: 'The git user name' | ||
| required: false | ||
| type: string | ||
| default: 'github-actions[bot]' | ||
| git-user-email: | ||
| description: 'The git user email' | ||
| required: false | ||
| type: string | ||
| default: '41898282+github-actions[bot]@users.noreply.github.com' | ||
| git-add-files: | ||
| description: 'The files to add to git' | ||
| required: false | ||
| type: string | ||
| version-previous: | ||
| description: 'The strategy to detect the previous version: auto, from-tag, from-file or manual' | ||
| required: false | ||
| default: 'auto' | ||
| type: string | ||
| version-next: | ||
| description: 'The strategy to calculate the next version: auto, semantic, from-file, increment or manual' | ||
| required: false | ||
| default: 'auto' | ||
| type: string | ||
| version-output-format: | ||
| description: 'The output format of the next version' | ||
| required: false | ||
| default: '{{.Major}}.{{.Minor}}.{{.Patch}}' | ||
| type: string | ||
| version-file: | ||
| description: 'Set version in file named as input' | ||
| required: false | ||
| type: string | ||
| version-makefile: | ||
| description: 'Set version in makefile named as input' | ||
| required: false | ||
| type: string | ||
| version-justfile: | ||
| description: 'Set version in justfile named as input' | ||
| required: false | ||
| type: string | ||
| version-package: | ||
| description: 'Set version in package json named as input' | ||
| required: false | ||
| type: string | ||
| version-package-lock: | ||
| description: 'Set version in package lock named as input' | ||
| required: false | ||
| type: string | ||
| version-script: | ||
| description: 'Set version in script named as input' | ||
| required: false | ||
| type: string | ||
| version-chart: | ||
| description: 'Set version in chart named as input' | ||
| required: false | ||
| type: string | ||
| make-target-pre-push: | ||
| description: 'The make target to run' | ||
| required: false | ||
| default: "" | ||
| type: string | ||
| push-git: | ||
| description: 'Push git changes' | ||
| required: false | ||
| default: true | ||
| type: boolean | ||
| fetch-depth: | ||
| description: 'Number of commits to fetch. 0 indicates all history for all branches and tags' | ||
| required: false | ||
| type: number | ||
| default: 0 | ||
| fetch-tags: | ||
| description: 'Whether to fetch tags' | ||
| required: false | ||
| type: boolean | ||
| default: true | ||
| submodules: | ||
| description: 'Whether to checkout submodules: true, false, or recursive' | ||
| required: false | ||
| type: boolean | ||
| default: true | ||
| permissions: | ||
| contents: write | ||
| jobs: | ||
| promote: | ||
| name: Promote | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: checkout repository | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: ${{ inputs.fetch-depth }} | ||
| fetch-tags: ${{ inputs.fetch-tags }} | ||
| submodules: ${{ inputs.submodules }} | ||
| token: ${{ secrets.checkout-token || secrets.GITHUB_TOKEN }} | ||
| - id: release_version | ||
| name: next release version | ||
| uses: getdevopspro/github-actions/release-version@v2.0.0 | ||
| with: | ||
| previous-version: ${{ inputs.version-previous }} | ||
| next-version: ${{ inputs.version-next }} | ||
| output-format: ${{ version-output-format }} | ||
| - name: set version in file | ||
| uses: getdevopspro/github-actions/version-file@v2.0.0 | ||
| with: | ||
| version: ${{ steps.release_version.outputs.version }} | ||
| version-makefile: ${{ inputs.version-makefile }} | ||
| version-justfile: ${{ inputs.version-justfile }} | ||
| version-package: ${{ inputs.version-package }} | ||
| version-package-lock: ${{ inputs.version-package-lock }} | ||
| version-script: ${{ inputs.version-script }} | ||
| version-chart: ${{ inputs.version-chart }} | ||
| - name: run make target before push | ||
| if: inputs.make-target-pre-push != '' | ||
| shell: bash | ||
| run: | | ||
| echo "run make target: ${{ inputs.make-target-pre-push }}" | ||
| make ${{ inputs.make-target-pre-push }} | ||
| - name: Push git version | ||
| uses: getdevopspro/github-actions/release-git-push@v2.0.0 | ||
| if: inputs.push-git | ||
| id: git_push | ||
| with: | ||
| version: ${{ steps.release_version.outputs.version }} | ||
| git-user-name: ${{ inputs.git-user-name }} | ||
| git-user-email: ${{ inputs.git-user-email }} | ||
| git-add-files: ${{ inputs.git-add-files }} | ||