# Action: auto-tag. Calculates (and optionally pushes) the next git tag # of the CONSUMING repo. Unrelated to releases of ci-templates itself. # # Inputs consumers set: # tag-type required tag prefix: dev, beta, prod, ... # tag-env optional "production" -> -.. scheme # push-tag optional "true" creates and pushes the tag (default "false") # push-token optional token with write access; required when push-tag=true # # Outputs: tag, previous-tag, stream # # Needs: bash and git on the runner, and a checkout with full tag history: # - uses: actions/checkout@v4 # with: { fetch-depth: 0 } name: auto-tag description: Calculates (and optionally pushes) the next git tag inputs: tag-type: description: "Tag prefix: dev, beta, prod, ..." required: true tag-env: description: "Set to production for the -.. scheme" required: false default: "" push-tag: description: "true creates and pushes the tag" required: false default: "false" push-token: description: "Token with write access. Required only when push-tag is true" required: false default: "" outputs: tag: description: The new tag value: ${{ steps.calc.outputs.TAG }} previous-tag: description: The latest existing tag with this prefix (empty if none) value: ${{ steps.calc.outputs.PREVIOUS_TAG }} stream: description: The tag type (prefix) value: ${{ steps.calc.outputs.STREAM }} runs: using: composite steps: - name: Calculate next tag id: calc shell: bash env: TAG_TYPE: ${{ inputs.tag-type }} TAG_ENV: ${{ inputs.tag-env }} PUSH_TAG: ${{ inputs.push-tag }} GIT_PUSH_TOKEN: ${{ inputs.push-token }} run: '"${{ github.action_path }}/../../scripts/auto-tag.sh"'