Compare commits

...

5 Commits
v5 ... v2.x

Author SHA1 Message Date
semantic-release-bot
9d2c65418d chore(release): 2.2.0 [skip ci]
# [2.2.0](http://github.com/rlespinasse/github-slug-action/compare/2.1.1...2.2.0) (2021-04-05)

### Features

* add version warning ([f536765](f536765da4))
2021-04-05 18:00:05 +00:00
rlespinasse
f536765da4 feat: add version warning 2021-04-05 19:59:17 +02:00
semantic-release-bot
72cfc4cb1f chore(release): 2.1.1 [skip ci]
## [2.1.1](http://github.com/rlespinasse/github-slug-action/compare/2.1.0...2.1.1) (2020-10-07)

### Bug Fixes

* remove set-env due to CVE fix ([d678898](d678898ce5))
2020-10-07 20:54:07 +00:00
rlespinasse
d678898ce5 fix: remove set-env due to CVE fix 2020-10-07 22:53:24 +02:00
Romain Lespinasse
f527ed6e85 docs: add reference to the v3.x branch 2020-09-26 09:12:06 +02:00
4 changed files with 57 additions and 13 deletions

View File

@@ -21,3 +21,25 @@ jobs:
@semantic-release/git@9.0.0
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./
- name: Output
run: |
echo "Slug variables"
echo " repository : ${{ env.GITHUB_REPOSITORY_SLUG }}"
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 "Slug URL variables"
echo " repository : ${{ env.GITHUB_REPOSITORY_SLUG_URL }}"
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 "Short SHA variables"
echo " sha : ${{ env.GITHUB_SHA_SHORT }}"

View File

@@ -1,3 +1,17 @@
# [2.2.0](http://github.com/rlespinasse/github-slug-action/compare/2.1.1...2.2.0) (2021-04-05)
### Features
* add version warning ([f536765](http://github.com/rlespinasse/github-slug-action/commit/f536765da448783f587c88e2c69f8f65b4e06541))
## [2.1.1](http://github.com/rlespinasse/github-slug-action/compare/2.1.0...2.1.1) (2020-10-07)
### Bug Fixes
* remove set-env due to CVE fix ([d678898](http://github.com/rlespinasse/github-slug-action/commit/d678898ce55139d0005c35618747506fbeb2d1ed))
# [2.1.0](http://github.com/rlespinasse/github-slug-action/compare/2.0.0...2.1.0) (2020-07-28)

View File

@@ -134,6 +134,13 @@ The master branch EOL is set on **2020-10-25** after a 6-month deprecation perio
When using this action on Windows or Macos workflows, A `##[error]Container action is only supported on Linux` error can be see in your workflow logs.
Currently, this action don't support a system other than Linux due to Github Action Limitation on `Container`-based action.
On the `v3.x` branch, this GitHub action have been rewrite to be able to run on Windows or Macos workflow.
```yaml
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v3.x
```
[1]: https://github.com/rlespinasse/github-slug-action/workflows/Build/badge.svg
[2]: https://github.com/rlespinasse/github-slug-action/actions
[3]: https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables

View File

@@ -39,17 +39,18 @@ get_event_keyvalue() {
fi
}
echo ::set-env name=GITHUB_REPOSITORY_SLUG::"$(slug "$GITHUB_REPOSITORY")"
echo ::set-env name=GITHUB_REPOSITORY_SLUG_URL::"$(slug_url "$GITHUB_REPOSITORY")"
{
echo "GITHUB_REPOSITORY_SLUG=$(slug "$GITHUB_REPOSITORY")"
echo "GITHUB_REPOSITORY_SLUG_URL=$(slug_url "$GITHUB_REPOSITORY")"
echo "GITHUB_REF_SLUG=$(slug_ref "$GITHUB_REF")"
echo "GITHUB_HEAD_REF_SLUG=$(slug_ref "$GITHUB_HEAD_REF")"
echo "GITHUB_BASE_REF_SLUG=$(slug_ref "$GITHUB_BASE_REF")"
echo "GITHUB_EVENT_REF_SLUG=$(slug_ref "$(get_event_keyvalue "ref")")"
echo "GITHUB_REF_SLUG_URL=$(slug_url_ref "$GITHUB_REF")"
echo "GITHUB_HEAD_REF_SLUG_URL=$(slug_url_ref "$GITHUB_HEAD_REF")"
echo "GITHUB_BASE_REF_SLUG_URL=$(slug_url_ref "$GITHUB_BASE_REF")"
echo "GITHUB_EVENT_REF_SLUG_URL=$(slug_url_ref "$(get_event_keyvalue "ref")")"
echo "GITHUB_SHA_SHORT=$(short_sha "$GITHUB_SHA")"
} >>"$GITHUB_ENV"
echo ::set-env name=GITHUB_REF_SLUG::"$(slug_ref "$GITHUB_REF")"
echo ::set-env name=GITHUB_HEAD_REF_SLUG::"$(slug_ref "$GITHUB_HEAD_REF")"
echo ::set-env name=GITHUB_BASE_REF_SLUG::"$(slug_ref "$GITHUB_BASE_REF")"
echo ::set-env name=GITHUB_EVENT_REF_SLUG::"$(slug_ref "$(get_event_keyvalue "ref")")"
echo ::set-env name=GITHUB_REF_SLUG_URL::"$(slug_url_ref "$GITHUB_REF")"
echo ::set-env name=GITHUB_HEAD_REF_SLUG_URL::"$(slug_url_ref "$GITHUB_HEAD_REF")"
echo ::set-env name=GITHUB_BASE_REF_SLUG_URL::"$(slug_url_ref "$GITHUB_BASE_REF")"
echo ::set-env name=GITHUB_EVENT_REF_SLUG_URL::"$(slug_url_ref "$(get_event_keyvalue "ref")")"
echo ::set-env name=GITHUB_SHA_SHORT::"$(short_sha "$GITHUB_SHA")"
echo "::warning ::This version only support linux-based workflow, please use 'rlespinasse/github-slug-action@v3.x' instead"