> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# mobomo/pr-semver

Auto Semantic Versioning based on PR tags


## Commands

### export-tag

Exports the new tag number as an Env Var.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `git-username` | string |  | The automation username to push the tag. |
| `ssh-fingerprint` | string |  | Environment fingerprints |
| `tag-prefix` | string |  | The tag prefix. |

### get-last-tag

Exports the last tag as an Env Var.


## Executors

### default

Docker image for jq and cURL based on alpine image.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `tag` | string | latest | Pick a specific makocchi/alpine-git-curl-jq image variant: https://hub.docker.com/r/makocchi/alpine-git-curl-jq/tags
 |

## Examples

### use_semver_in_jobs

Example of job using the commands `export-tag` and `get-last-tag`


```yaml
version: '2.1'
orbs:
  pr-semver: mobomo/pr-semver@1.0.0
workflows:
  nightly:
    jobs:
      - deploy-tag:
          pre-steps:
            - pr-semver/get-last-tag
          tag: $LAST_TAG
    triggers:
      - schedule:
          cron: 0 7 * * *
          filters:
            branches:
              only:
                - develop
  release-tag-creation:
    jobs:
      - build-release-tag:
          filters:
            branches:
              only:
                - develop
          post-steps:
            - git-publisher:
                tag: $NEW_SEMVER_TAG
          pre-steps:
            - pr-semver/export-tag:
                git-username: jidrone-mbm
                tag-prefix: build-v
```