semantic-release-bot fbf6d7b9c7 chore(release): 1.2.0 [skip ci]
# [1.2.0](http://github.com/rlespinasse/github-slug-action/compare/1.1.1...1.2.0) (2021-04-05)

### Features

* add deprecation warning ([c9eec68](c9eec68e1a))
2021-04-05 17:59:17 +00:00
2021-04-05 19:58:34 +02:00
2020-04-25 22:04:15 +02:00
2020-04-25 22:04:15 +02:00
2019-11-07 00:02:28 +01:00
2020-04-25 22:04:15 +02:00
2021-04-05 17:59:17 +00:00
2019-11-07 12:23:07 +01:00
2019-11-06 01:05:03 +01:00
2021-04-05 19:58:34 +02:00
2020-04-25 22:04:15 +02:00
2020-05-01 17:16:24 +02:00
2020-05-01 17:16:24 +02:00
2020-04-25 22:04:15 +02:00

GitHub Slug action

Actions Status

This action slug and expose some github variables.

Slug a variable will

  • put the variable content in lower case,
  • replace any character by - except 0-9 and a-z,
  • remove leading and trailing - character,
  • limit the string size to 63 characters.

Others Slug-ish commands are available:

  • Short SHA a variable will limit the string size to 8 characters.

Exposed environment variables

- uses: rlespinasse/github-slug-action@v1.1.x
- name: Print slug variables
  run: |
    echo ${{ env.GITHUB_REF_SLUG }}
    echo ${{ env.GITHUB_HEAD_REF_SLUG }}
    echo ${{ env.GITHUB_BASE_REF_SLUG }}
    echo ${{ env.GITHUB_SHA_SHORT }}

Read default environment variables page for more information.

GITHUB_REF_SLUG

Slug the environment variable GITHUB_REF

The branch or tag ref that triggered the workflow. If neither a branch or tag is available for the event type, the variable will not exist.

Environment variable (GITHUB_REF) Slug variable (GITHUB_REF_SLUG)
refs/heads/master master
refs/heads/feat/new_feature feat-new-feature
refs/tags/v1.0.0 v1-0-0
refs/tags/product@1.0.0-rc.2 product-1-0-0-rc-2
refs/heads/New_Awesome_Product new-awesome-product

Additional variables (only set for forked repositories) :

  • GITHUB_HEAD_REF_SLUG : The branch of the head repository GITHUB_HEAD_REF,
  • GITHUB_BASE_REF_SLUG : The branch of the base repository GITHUB_BASE_REF.

GITHUB_SHA_SHORT

Short the environment variable GITHUB_SHA

The commit SHA that triggered the workflow

Environment variable (GITHUB_SHA) Short variable (GITHUB_SHA_SHORT)
ffac537e6cbbf934b08745a378932722df287a53 ffac537e
Languages
Shell 100%