Coder Social home page Coder Social logo

rlespinasse / github-slug-action Goto Github PK

View Code? Open in Web Editor NEW
241.0 5.0 36.0 1.22 MB

GitHub Action to expose slug value of GitHub environment variables inside your GitHub workflow

License: MIT License

Shell 100.00%
slug continuous-integration continuous-delivery continuous-deployment short workflows github-actions hacktoberfest

github-slug-action's Introduction

GitHub Slug action

This GitHub Action will expose the slug/short values of some GitHub environment variables inside your GitHub workflow.

Table of Contents

Overview

SLUG on a variable will

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

  • SLUG_URL on a variable to have a slug variable compliant to be used in an URL
    • Like SLUG but ., and _ are also replaced by -
  • SHORT on a variable will limit the string size to ~8 characters
    • Useful for sha value
  • <KEY>_PART on a variable will give a part of a variable defined by a key
    • Like GITHUB_REPOSITORY_OWNER_PART for the owner part of GITHUB_REPOSITORY
  • <VAR>_CS on others variables to keep the value case-sensitive
    • Like GITHUB_REF_SLUG_CS

Additional enhanced environment variables can be compute to help you around GitHub environment variables.

Use this action

Add this in your workflow

- name: Inject slug/short variables
  uses: rlespinasse/github-slug-action@v4
Others configurations

  • With a prefix

    - name: Inject slug/short variables
      uses: rlespinasse/github-slug-action@v4
      with:
        prefix: CI_
  • With another max length for slug values

    - name: Inject slug/short variables
      uses: rlespinasse/github-slug-action@v4
      with:
        slug-maxlength: 80 # Use 'nolimit' to remove use of a max length (Default to 63)
  • With another length for short values

    - name: Inject slug/short variables
      uses: rlespinasse/github-slug-action@v4
      with:
        short-length: 7 # By default it's up to git to decide, use 8 to have the v3.x behavior

    Warning: If you leave it empty, you need to checkout the source first in order to let git decide the size by itself.

Check for more examples (OS usage, URL use, ...)

Tip: Use Dependabot to maintain your github-slug-action version updated in your GitHub workflows.

Migration from previous versions

The short sha length is not the same as previous version.

  • v4 let git configuration decide of it (but you can override it),
  • v3 and before, it's always a length of 8 characters.

So to reproduce previous behavior, use

- name: Inject slug/short variables
  uses: rlespinasse/github-slug-action@v4
  with:
    short-length: 8 # Same as v3 and before

Available Environment variables

Note: If you don't find what you search for, read more about available GitHub variables, and propose a new custom variable.

Enhanced variables

  • GITHUB_REF_NAME will contains the reference name (branch or tag)
    • based on GITHUB_HEAD_REF in a pull-request* event context,
    • based on GITHUB_REF in others event context.

NOTE: All enhanced variables are available in all slug formats.

Partial variables

Variable Partial version of Description
GITHUB_REPOSITORY_OWNER_PART GITHUB_REPOSITORY The Owner part of GITHUB_REPOSITORY variable
GITHUB_REPOSITORY_NAME_PART GITHUB_REPOSITORY The Repository name part of GITHUB_REPOSITORY variable

Slug variables

NOTE: _CS suffix available

Variable Slug version of Description
GITHUB_REPOSITORY_SLUG GITHUB_REPOSITORY The owner and repository name.
GITHUB_REPOSITORY
_OWNER_PART_SLUG
GITHUB_REPOSITORY_OWNER_PART The owner name.
GITHUB_REPOSITORY
_NAME_PART_SLUG
GITHUB_REPOSITORY_NAME_PART The repository name.
GITHUB_REF_SLUG GITHUB_REF The branch or tag ref that triggered the workflow.
GITHUB_HEAD_REF_SLUG GITHUB_HEAD_REF The branch of the head repository.
Only set for [pull-request][event-pull-request] event and forked repositories.
GITHUB_BASE_REF_SLUG GITHUB_BASE_REF The branch of the base repository.
Only set for [pull-request][event-pull-request] event and forked repositories.
GITHUB_EVENT_REF_SLUG github.event.ref
Only set for following webhook events
  • create
  • delete

Slug URL variables

NOTE: _CS suffix available

Variable Slug URL version of Description
GITHUB_REPOSITORY_SLUG_URL GITHUB_REPOSITORY The owner and repository name.
GITHUB_REPOSITORY
_OWNER_PART_SLUG_URL
GITHUB_REPOSITORY_OWNER_PART The owner name.
GITHUB_REPOSITORY
_NAME_PART_SLUG_URL
GITHUB_REPOSITORY_NAME_PART The repository name.
GITHUB_REF_SLUG_URL GITHUB_REF The branch or tag ref that triggered the workflow.
GITHUB_HEAD_REF_SLUG_URL GITHUB_HEAD_REF The branch of the head repository.
Only set for pull-request event and forked repositories.
GITHUB_BASE_REF_SLUG_URL GITHUB_BASE_REF The branch of the base repository.
Only set for pull-request event and forked repositories.
GITHUB_EVENT_REF_SLUG_URL github.event.ref
Only set for following webhook events
  • create
  • delete

Short variables

Variable Short version of Description
GITHUB_SHA_SHORT GITHUB_SHA The commit SHA that triggered the workflow.
GITHUB_EVENT
_PULL_REQUEST
_HEAD_SHA_SHORT
github.event
.pull_request
.head.sha
The commit SHA on pull request that trigger workflow.
Only set for following webhook events
  • pull_request
  • pull_request_review
  • pull_request_review_comment
  • pull_request_target

Troubleshooting

The SHORT variables doesn't have the same lengths as before

Since v4, it's git who manage the short variables by using git rev-parse behaviour. The length of a short sha depends of the size of our repository and can differ over time.

To manage that moving length, you can use short-length input

  • set 7 to reproduce small repository behavior
  • set 8 to reproduce v3 behavior

Warning: The minimum length is 4, the default is the effective value of the core.abbrev configuration variable.

One of the environment variables doesn't work as intended

Note: When you set a custom environment variable, you cannot use any of the default environment variable names. For a complete list of these, see Default environment variables. If you attempt to override the value of one of these default environment variables, the assignment is ignored.

If a variable start to be used as default environment variable, the environment variable may have a different behavior than the expected one.

If this append, the ${{ env.GITHUB_AWESOME_VARIABLE }} and $GITHUB_AWESOME_VARIABLE expression will not works in the same way.

  • ${{ env.GITHUB_AWESOME_VARIABLE }} will serve the behavior of this action,
  • $GITHUB_AWESOME_VARIABLE will serve the behavior of GitHub Action.

Otherwise the two expression will serve the behavior of this action. This will not occurs if you use the prefix input to avoid the issue.

NOTE: If detected, the maintainers of this action will choose the best course of action depending of the impact.

Known environment variable conflicts

GITHUB_REF_NAME

The behavior is the same as the GitHub one except on pull_request* workflows (Ready the full story).

  • ${{ env.GITHUB_REF_NAME }} will serve the behavior of this action,
  • $GITHUB_REF_NAME will serve the behavior of GitHub Action.

On pull_request* workflows, the content will be <PR-number>/merge instead of the branch name.

A possible workaround is to use prefix input

- name: Inject slug/short variables
  uses: rlespinasse/github-slug-action@v4
  with:
    prefix: CI_

Then ${{ env.CI_GITHUB_REF_NAME }}, and $CI_GITHUB_REF_NAME will serve the behavior of this action. And $GITHUB_REF_NAME will serve the behavior of GitHub Action.

An action could not be found at the URI

If your workflow fail on the Set up job task with this kind of log

Download action repository 'rlespinasse/github-slug-action@GIT_REFERENCE'
##[error]An action could not be found at the URI 'https://api.github.com/repos/rlespinasse/github-slug-action/tarball/GIT_REFERENCE'

If the GIT_REFERENCE value is

  • v4.x or after, the branch don't exists anymore following the end-of-life for a branch security process.
  • master, the branch don't exists anymore, read more about it on the corresponding issue (EOL issue)

Please, use the current major tag v4 or a version tag (see releases pages) in order to fix your workflow.

Thanks for talking about us

In English 🇬🇧

In French 🇫🇷

In Chinese 🇨🇳

The next one is you. Don't hesitate to add youself to one of these lists.

github-slug-action's People

Contributors

ameausoone avatar dependabot[bot] avatar eryajf avatar helaili avatar jbcpollak avatar madjlzz avatar nickittynack avatar php-coder avatar rlespinasse avatar semantic-release-bot avatar tryvin avatar tsmmark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

github-slug-action's Issues

Change the way a new version is produced

Starting on v4.X branch, only a tag will have the dist folder on a tag and not the associated branch (like now).
A branch will not be used anymore due to the fact that the action is not pre-compile inside.
As this change is a breaking one, we will use the v4.x branch series to highlight that.

GITHUB_SHA_SHORT returning variable length

Describe the bug
@rlespinasse sometimes this action is getting a SHA with a length of 7 and sometimes with a length of 8, which crashes some actions.

See this examples:

Correct len(7) for GITHUB_SHA_SHORT: https://github.com/ZcashFoundation/zebra/runs/5618372155?check_suite_focus=true#step:3:977

Wrong len(8) for GITHUB_SHA_SHORT: https://github.com/ZcashFoundation/zebra/runs/5618372108?check_suite_focus=true#step:3:1017

This happens in the same action, almost duplicating the same steps

To Reproduce
Use @v4 of this action

Expected behavior
Always return the same length for the GITHUB_SHA_SHORT

Warning for breaking changes

This change here breaks every workflow that used the GITHUB_REF_SLUG on services that require slugs starting with a letter.

Before it was guaranteed to have a value like refs-pull-<pr number>-merge and now it is <pr number>-merge.
Took us a while to find why our staging deployments suddenly stopped working. Could that be added to the release notes so others will find it more quickly?

GITHUB_SHA_SHORT Not Working in V4

Describe the bug
GITHUB_SHA_SHORT variable is not being populated in v4 for the action.

To Reproduce
Add rlespinasse/github-slug-action@v4 action
Try to access env.GITHUB_SHA_SHORT

Expected behavior
GITHUB_SHA_SHORT contains the short SHA

Additional context
I replaced rlespinasse/github-slug-action@v4 with rlespinasse/[email protected] and the variable works.

Error on GitHub Enterprise Server 3.6.2 since [email protected]

Hello 👋,

Describe the bug
We've got an error since [email protected] on GitHub Enterprise Server 3.6.2:

Here are the logs:

Run rlespinasse/github-slug-action@v4
  with:
    prefix: SL_SH_
    slug-maxlength: 6[3](https://git.epo.org/ds/cv-pipelines/runs/52955?check_suite_focus=true#step:4:3)
Run $GITHUB_ACTION_PATH/preflight.sh
  $GITHUB_ACTION_PATH/preflight.sh
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail ***0***
  env:
    INPUT_SLUG_MAXLENGTH: 63
    INPUT_SHORT_LENGTH: 
/runner/_work/_actions/rlespinasse/github-slug-action/v[4](https://git.epo.org/ds/cv-pipelines/runs/52955?check_suite_focus=true#step:4:4)/preflight.sh: line 34: : No such file or directory

Seems that it's linked to the update to use GITHUB_OUTPUT:
https://github.com/rlespinasse/github-slug-action/pull/117/files
Why this update was needed ?

It's working well if we pin [email protected].

Thanks for your help 🙏

Do not replace periods with dashes

I am trying to use this action with building version tags. Using this action when I create a tag e.g. v3.0.0 this variable GITHUB_REF_SLUG will be v3-0-0.

My suggestion is to don't replace periods or create a new environment variable that we can use for tags.

End of life of v3

Following the security rules of this repository, the v3.x branch will be removed after a 3-month period.

During this time, the security patches will be apply to it.

Reporting a vulnerability

Hello!

I hope you are doing well!

We are a security research team. Our tool automatically detected a vulnerability in this repository. We want to disclose it responsibly. GitHub has a feature called Private vulnerability reporting, which enables security research to privately disclose a vulnerability. Unfortunately, it is not enabled for this repository.

Can you enable it, so that we can report it?

Thanks in advance!

PS: you can read about how to enable private vulnerability reporting here: https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository

The automated release is failing 🚨

🚨 The automated release from the v3.x branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the v3.x branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Cannot push to the Git repository.

semantic-release cannot push the version tag to the branch v3.x on the remote Git repository with URL http://x-access-token:[secure]@github.com/rlespinasse/github-slug-action.git.

This can be caused by:


Good luck with your project ✨

Your semantic-release bot 📦🚀

underscore (_) in branch name is replaced with dash (-)

Describe the bug
see issue title

To Reproduce
print the env vars and see that the branch name has dashes instead of underscores

Expected behavior
The env var should include the actual branch name, not replace any characters.

Screenshots
Screen Shot 2021-03-30 at 11 22 07 AM

Additional context
Thanks for the really useful package!

Feature: domain name compatible slug (no underscores)

Is your feature request related to a problem? Please describe.
We're using the slug action to generate preview site URLs from git branch names. The slug is used as a subdomain (or sub-subdomain) pointing to the respective deployment.
We naively thought that the SLUG_URL slugs are good for that but realized the hard way that the hostname part of the DNS name cannot generally have underscores. It's a bit messy ( https://en.wikipedia.org/wiki/Hostname#Syntax ) but I conclude that it's at least not a safe assumption (and did in fact not work in our case).

Describe the solution you'd like
Either

  • change the behavior of SLUG_URL (because a "URL" contains a "hostname" as a part and assuming you can use that slug anywhere in a full URL is not correct). But that would be a breaking change.
  • find some other means of supporting the use case. Extra exclusion characters configurable? Yet another set of variables like SLUG_HOSTNAME?

All

Describe alternatives you've considered

  • dropping this action for a custom script (not ideal, needs to be maintained too)
  • tolerating the error somehow (currently not possible, it's wrapped into other actions)

Additional context
I'm sorry to come up with yet another feature request...

GITHUB_SHA different value for PR events

Is your feature request related to a problem? Please describe.

Actually, GitHub is changing the value of GITHUB_SHA for pull request events that refers to the last merge commit on the GITHUB_REF branch. At first, I would expect that it refers to the last commit of the branch. I wanted to use this behaviour for tagging container images build from PR events.

github-slug-action is actually working as intended.

Describe the solution you'd like

I would like to have a way of telling github-slug-action that I want to get the value of the last commit of my branch instead the logic used by GitHub.

Here's some track to get us started:

I did not try those solutions yet.

Describe alternatives you've considered

/

Additional context

/

WDYT?

Change Tagging To `vX.Y.Z`

Is your feature request related to a problem? Please describe.
When tagging a specific version of this action within a workflow, you must use the syntax x.y.z rather than the standard vx.y.z that all official actions make use of.

Describe the solution you'd like
Change tagging on releases to include a leading v.

Describe alternatives you've considered
N/A

Additional context
N/A

Bug: `SLUG_URL` can end with a hyphen

Describe the bug
We're using the slug action to generate preview site URLs from git branch names. The slug is used as a subdomain (or sub-subdomain) pointing to the respective deployment. That works pretty well, mainly thanks to your quick response the last time. Thank you again for that! 🙌🏼
But now we ran into another issue.
We are using the SLUG_URL to create the subdomain and slug-maxlength to adjust the length of the slug to our needs.
We noticed that sometimes, when our branch name is too long and the slug length is being adjusted (or trimmed to the right length) that it can happen that the slug url is ending with an hyphen, which is not a valid hostname in the URL. That gives us an error when we try to create the subdomains.
If I understand the documentation correctly, the trailing - should be removed from the slug. But I guess this is not covered when using the slug-maxlength configuration. 🤔

To Reproduce

  • Use a long string with hyphens in between words.
  • Use SLUG_URL with slug-maxlength to create a slug out of the string that is shorter than the original string
  • Try to find the right length of either the string or the maxlength to truncate the string that it ends with an hyphen

Expected behavior
The SLUG_URL should never end with a hyphen.

Screenshots
As you can see, we tried to use the SLUG_URL (our branch name) as subdomain. And in this particular case, the branch name was truncated to the configured length and ended with a hyphen.
image (1)

Additional context
Thank you very much for the quick support you gave us so far! We hope we can help you with this contribution :)

Feature wish: option to set a different slug length than 63

(updated to account for being able to use the prefix parameter)

Is your feature request related to a problem? Please describe.
I need a slug that, including our prefix, fits into less than 63 characters because I have a different length limit than 63.

Describe the solution you'd like
an optional with parameter to set a different limit (or no limit if someone has that use case because technically branch names could collide).

Describe alternatives you've considered
Custom scripting, e.g. an action step that runs a script that takes the env var and provides an output. That's pretty near to building an own custom github action like this)

Additional context
Thank you very much for your work, this is a nice and useful action.

Case-sensitive GITHUB_HEAD_REF_SLUG

Is your feature request related to a problem? Please describe.
I am using the GITHUB_HEAD_REF_SLUG to pass a branch name into an action. That variable is always lowercase, but my action needs the case-sensitive version of the slug.

Describe the solution you'd like
Branches are passed in with capital letters respected. Either in this variable or a new, case-sensitive one.

Determine variable(s) from input

Is your feature request related to a problem? Please describe.

Need: determine the slug version of an input variable.
Depending on the workflow, github.ref is not necessarily the desired value (especially for manual deployment workflow).

Describe the solution you'd like

A solution could be to allow to override github.ref with ref parameter (the default value remains what it is, so it is backward compatible).

- name: Inject slug/short variables
  uses: rlespinasse/[email protected]
  with:
    ref: ${{ my-ref }}

Describe alternatives you've considered

Another solution could be to access the action's function via a script.

- name: Inject slug/short variables
  uses: rlespinasse/[email protected]
  with:
    script: exportSlugRefCS("${{ my-ref }}", "MY_GITHUB_REF_SLUG_CS")

Additional context
n/a

Use ref as input?

Is your feature request related to a problem? Please describe.

I have a CI pipeline in some web project that automatically updates test installations so that whenever somebody pushes some branches etc. there is a corresponding installation being setup where you can see the result. I am using this plugin to build docker images (or better put their tags) and publish them onto my testservers.

Now I have the problem that this creates many many test installations (which is expected ;) ). As PRs and branches are merged and closed the installations should go away as well. You can do that on github using

on: [delete]

in your workflow file. The problem is that this workflow is always being triggered on the default branch. This is obviously not really helpfult ;) The corresponding deleted branch/pr is available using ${{ github.event.ref }}

Describe the solution you'd like

I want to reuse the exact same logic that I am using to deploy in this case. If I could optionally specify some tag input everything would be fine. Namely I want this plugin to support something like this:

      - name: Inject slug/short variables
        uses: rlespinasse/[email protected]
        with:
          # github.ref is always the default branch for deletion...need to extract branch from delete event!
          ref: ${{ github.event.ref }}

Describe alternatives you've considered

Additional context

Get current branch even on tag event

Is your feature request related to a problem? Please describe.
It could be useful to get current branch, even when pipeline has been triggered by a tag event.

Describe the solution you'd like
Get a variable which provide current branch.

Describe alternatives you've considered
N/A

Additional context
N/A

GITHUB_REF_SLUG on pull request differs between v2.x and v3.x

On pull_request event, the GITHUB_REF value is refs/pull/<pr number>-merge
So,

  • on v2.x, the value is <pr number>-merge
  • on v3.x, the value is refs-pull-<pr number>-merge

During the migration from docker-based action (v2.x) to javascript-based action (v3.x), the bug have been introduce.

dist files are not updated during release

Describe the bug
During release phase, the dist files are updated with the release

To Reproduce
Make a release 😄

Expected behavior
the dist files are updated with the release

Prepare the ownership change of this action

In order to improve the governance and the future of this action, I created a GitHub organization called Actions-Able which is composed of other action maintainers and co-maintainers I work with.

This issue concerns preparing the migration to this new ownership without breaking the current use of rlespinasse/github-slug-action@... in our user workflows.

github-slug-action - master branch EOL

Due to changes into the branches management, the master branch is not longer supported and will be removed in few months (EOL: 2020-10-25).

After a search, here is the list of projects who use master branch for this action inside their workflows.

GitHub define GITHUB_REF_NAME as default environment variable

Describe the bug
GitHub releases a new environment variable: GITHUB_REF_NAME.
Since this action also uses GITHUB_REF_NAME name.
The GitHub version cannot be overwritten by this action, and the export is silently discarded.
The action version doesn't fill this variable the same way GitHub does.
And the current content doesn't match the content produced by this action (before the GitHub release) on pull request event.

On GitHub-side, GITHUB_REF_NAME is GITHUB_REF without the refs prefix.

  • pull-request event GITHUB_REF = refs/pull/42/merge
  • GitHub version of GITHUB_REF_NAME = 42/merge
  • Action version of GITHUB_REF_NAME = <Name of the head branch of PR 42>

To Reproduce
Use this action on a pull request-based workflow.

Expected behavior
GITHUB_REF_NAME contains the branch behind the Pull request.

Rework the documentation

Nearly everything is in the README, maybe we can find a better way to express all documentation sections in a better structure.

Provide a shared env variable between "pull_request" and "push" events for the branch name

Is your feature request related to a problem? Please describe.
The value of GITHUB_REF_SLUG is different depending on whether a pull_request/push event is the origin.

It makes it harder to write scripts where we don't really care what's the event, we only want the branch name.

Run rlespinasse/[email protected]
##[debug]Node Action run completed with exit code 0
##[debug]GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT='8c2d7bad'
##[debug]GITHUB_REPOSITORY_OWNER_PART='UnlyEd'
##[debug]GITHUB_REPOSITORY_NAME_PART='github-action-deploy-on-vercel'
##[debug]GITHUB_REPOSITORY_SLUG='unlyed-github-action-deploy-on-vercel'
##[debug]GITHUB_REPOSITORY_SLUG_CS='UnlyEd-github-action-deploy-on-vercel'
##[debug]GITHUB_REPOSITORY_OWNER_PART_SLUG='unlyed'
##[debug]GITHUB_REPOSITORY_OWNER_PART_SLUG_CS='UnlyEd'
##[debug]GITHUB_REPOSITORY_NAME_PART_SLUG='github-action-deploy-on-vercel'
##[debug]GITHUB_REPOSITORY_NAME_PART_SLUG_CS='github-action-deploy-on-vercel'
##[debug]GITHUB_REPOSITORY_SLUG_URL='unlyed-github-action-deploy-on-vercel'
##[debug]GITHUB_REPOSITORY_SLUG_URL_CS='UnlyEd-github-action-deploy-on-vercel'
##[debug]GITHUB_REPOSITORY_OWNER_PART_SLUG_URL='unlyed'
##[debug]GITHUB_REPOSITORY_OWNER_PART_SLUG_URL_CS='UnlyEd'
##[debug]GITHUB_REPOSITORY_NAME_PART_SLUG_URL='github-action-deploy-on-vercel'
##[debug]GITHUB_REPOSITORY_NAME_PART_SLUG_URL_CS='github-action-deploy-on-vercel'
##[debug]GITHUB_REF_SLUG='18-merge'
##[debug]GITHUB_REF_SLUG_CS='18-merge'
##[debug]GITHUB_HEAD_REF_SLUG='feature-dynamic-aliases'
##[debug]GITHUB_HEAD_REF_SLUG_CS='feature-dynamic-aliases'
##[debug]GITHUB_BASE_REF_SLUG='main'
##[debug]GITHUB_BASE_REF_SLUG_CS='main'
##[debug]GITHUB_REF_SLUG_URL='18-merge'
##[debug]GITHUB_REF_SLUG_URL_CS='18-merge'
##[debug]GITHUB_HEAD_REF_SLUG_URL='feature-dynamic-aliases'
##[debug]GITHUB_HEAD_REF_SLUG_URL_CS='feature-dynamic-aliases'
##[debug]GITHUB_BASE_REF_SLUG_URL='main'
##[debug]GITHUB_BASE_REF_SLUG_URL_CS='main'
##[debug]GITHUB_SHA_SHORT='b97c3a2a'
##[debug]Finishing: Expose GitHub slug/short variables
Run rlespinasse/[email protected]
##[debug]Node Action run completed with exit code 0
##[debug]GITHUB_EVENT_REF_SLUG='feature-dynamic-aliases'
##[debug]GITHUB_EVENT_REF_SLUG_CS='feature-dynamic-aliases'
##[debug]GITHUB_EVENT_REF_SLUG_URL='feature-dynamic-aliases'
##[debug]GITHUB_EVENT_REF_SLUG_URL_CS='feature-dynamic-aliases'
##[debug]GITHUB_REPOSITORY_OWNER_PART='UnlyEd'
##[debug]GITHUB_REPOSITORY_NAME_PART='github-action-deploy-on-vercel'
##[debug]GITHUB_REPOSITORY_SLUG='unlyed-github-action-deploy-on-vercel'
##[debug]GITHUB_REPOSITORY_SLUG_CS='UnlyEd-github-action-deploy-on-vercel'
##[debug]GITHUB_REPOSITORY_OWNER_PART_SLUG='unlyed'
##[debug]GITHUB_REPOSITORY_OWNER_PART_SLUG_CS='UnlyEd'
##[debug]GITHUB_REPOSITORY_NAME_PART_SLUG='github-action-deploy-on-vercel'
##[debug]GITHUB_REPOSITORY_NAME_PART_SLUG_CS='github-action-deploy-on-vercel'
##[debug]GITHUB_REPOSITORY_SLUG_URL='unlyed-github-action-deploy-on-vercel'
##[debug]GITHUB_REPOSITORY_SLUG_URL_CS='UnlyEd-github-action-deploy-on-vercel'
##[debug]GITHUB_REPOSITORY_OWNER_PART_SLUG_URL='unlyed'
##[debug]GITHUB_REPOSITORY_OWNER_PART_SLUG_URL_CS='UnlyEd'
##[debug]GITHUB_REPOSITORY_NAME_PART_SLUG_URL='github-action-deploy-on-vercel'
##[debug]GITHUB_REPOSITORY_NAME_PART_SLUG_URL_CS='github-action-deploy-on-vercel'
##[debug]GITHUB_REF_SLUG='feature-dynamic-aliases'
##[debug]GITHUB_REF_SLUG_CS='feature-dynamic-aliases'
##[debug]GITHUB_REF_SLUG_URL='feature-dynamic-aliases'
##[debug]GITHUB_REF_SLUG_URL_CS='feature-dynamic-aliases'
##[debug]GITHUB_SHA_SHORT='8c2d7bad'
##[debug]Finishing: Expose GitHub slug/short variables

We can see in the first case we should use the GITHUB_HEAD_REF_SLUG and in the second case it should be GITHUB_REF_SLUG.

Describe the solution you'd like
Adding a GITHUB_BRANCH_NAME env variable that is contains the branch name in both cases.

Describe alternatives you've considered
Writing our own custom if/else in github action, but that could be avoided.

Error: The input 'lenght' is mandatory with 'short-on-error' set to 'true' in v4.2.0

Describe the bug
Workflow including this action fails with:

Error: The input 'lenght' is mandatory with 'short-on-error' set to 'true'
Error: Process completed with exit code 1.

To Reproduce

        steps:
            - name: Inject GitHub Short Names
              uses: rlespinasse/[email protected]

Expected behavior
Workflow does not fail.

Additional context
Note that lenght is misspelled in the error message, which might be an indicator of where the issue stems from?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.