+ Others Slug-ish commands are available
+
-- `Slug URL` a variable will be like the `slug` variable but the `.` character will also be replaced by `-`
-- `Short SHA` a variable will limit the string size to 8 characters
+- `SLUG_URL` a variable to have a `slug` variable compliant to be used in an URL (Like `SLUG` but `.` is also replaced by `-`)
+- `SHORT` a variable will limit the string size to 8 characters (useful for _sha_ value)
-## Exposed GitHub environment variables
+
+
+
+## Use this action
+
+Add this in your workflow
```yaml
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v3.x
-
-- name: Print slug/short variables
- run: |
- echo "Slug variables"
- echo " ref : ${{ env.GITHUB_REF_SLUG }}"
- echo " head ref : ${{ env.GITHUB_HEAD_REF_SLUG }}"
- echo " base ref : ${{ env.GITHUB_BASE_REF_SLUG }}"
- echo " event ref : ${{ env.GITHUB_EVENT_REF_SLUG }}"
- echo " repository : ${{ env.GITHUB_REPOSITORY_SLUG }}"
- echo "Slug URL variables"
- echo " ref : ${{ env.GITHUB_REF_SLUG_URL }}"
- echo " head ref : ${{ env.GITHUB_HEAD_REF_SLUG_URL }}"
- echo " base ref : ${{ env.GITHUB_BASE_REF_SLUG_URL }}"
- echo " event ref : ${{ env.GITHUB_EVENT_REF_SLUG_URL }}"
- echo " repository : ${{ env.GITHUB_REPOSITORY_SLUG_URL }}"
- echo "Short SHA variables"
- echo " sha : ${{ env.GITHUB_SHA_SHORT }}"
- echo " pull request sha : ${{ env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT }}"
```
-Read [default environment variables][3] page for more information.
+Check for more [examples][3] (OS usage, URL use, ...)
-**TIP:** Use [Dependabot][14] to maintain your `github-slug-action` version updated in your GitHub workflows.
+**Tip:** Use [Dependabot][14] to maintain your `github-slug-action` version updated in your GitHub workflows.
-### GITHUB_REF_SLUG / GITHUB_REF_SLUG_URL
+## Available Environment variables
-Slug the environment variable **GITHUB_REF**
+**Note**: If you don't find what you search for, read more about [available `GitHub` variables](docs/github-variables.md), and propose a [new custom variable][5].
-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._
+### Slug variables
-| GITHUB_REF | GITHUB_REF_SLUG | GITHUB_REF_SLUG_URL |
-| ------------------------------ | ------------------- | ------------------- |
-| refs/heads/master | master | master |
-| refs/heads/feat/new_feature | feat-new-feature | feat-new-feature |
-| refs/tags/v1.0.0 | v1.0.0 | v1-0-0 |
-| refs/tags/product@1.0.0-rc.2 | product-1.0.0-rc.2 | product-1-0-0-rc-2 |
-| refs/heads/New_Awesome_Product | new-awesome-product | new-awesome-product |
+| Variable | Slug version of | Description |
+| ----------------------------------------------------------------------- | ------------------ | ----------------------------------------------------------------------- |
+| [GITHUB_REPOSITORY_SLUG](docs/slug-variables.md#GITHUB_REPOSITORY_SLUG) | GITHUB_REPOSITORY | The owner and repository name. |
+| [GITHUB_REF_SLUG](docs/slug-variables.md#GITHUB_REF_SLUG) | GITHUB_REF | The branch or tag ref that triggered the workflow. |
+| [GITHUB_HEAD_REF_SLUG](docs/slug-variables.md#GITHUB_HEAD_REF_SLUG) | GITHUB_HEAD_REF | The branch of the head repository.