All Projects → rlespinasse → Github Slug Action

rlespinasse / Github Slug Action

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

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Github Slug Action

Origin
Conformance test suite for OpenShift
Stars: ✭ 8,046 (+8281.25%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Docker For All
Docker applied in development, devops, testing, product management etc.
Stars: ✭ 88 (-8.33%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Agent
The Buildkite Agent is an open-source toolkit written in Golang for securely running build jobs on any device or network
Stars: ✭ 534 (+456.25%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Git Push Deploy
Simple Automated CI/CD Pipeline for GitHub and GitLab Projects
Stars: ✭ 21 (-78.12%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Dyn365 Ce Vsts Tasks
VSTS Extension for Dynamics 365 Customer Engagement
Stars: ✭ 94 (-2.08%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Bzppx Codepub
暴走皮皮虾之代码发布系统,是现代的持续集成发布系统,由后台管理系统和agent两部分组成,一个运行着的agent就是一个节点,本系统并不是造轮子,是"鸟枪"到"大炮"的创新,对"前朝遗老"的革命.
Stars: ✭ 471 (+390.63%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Piplin
📤 An open source self-hosted continuous integration and deployment system - QQ群: 656868
Stars: ✭ 1,044 (+987.5%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Hygieia
CapitalOne DevOps Dashboard
Stars: ✭ 3,682 (+3735.42%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Flagsmith Frontend
Web App and Mobile App for Flagsmith
Stars: ✭ 86 (-10.42%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Buddy Cli
CLI tool for Buddy Cloud
Stars: ✭ 69 (-28.12%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Dyn365 Ce Devops
DevOps for Dynamics 365 Customer Engagement (CE) is becoming a popular topic. The goal of this project is to help Dynamics 365 CE solution builders understand and accelerate their implementation of DevOps practices with Dynamics CE and VSTS.
Stars: ✭ 82 (-14.58%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Haiku
🚀 Instant Heroku deploys from GitHub branches
Stars: ✭ 17 (-82.29%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Devops Readme.md
What to Read to Learn More About DevOps
Stars: ✭ 398 (+314.58%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Lightning Sites
☁️ Lightning deployment for your ~/Sites folders
Stars: ✭ 8 (-91.67%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Circleci Images
Scripts to generate images for building projects on CircleCI 2.0
Stars: ✭ 397 (+313.54%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Abstruse
Abstruse is a free and open-source CI/CD platform that tests your models and code.
Stars: ✭ 704 (+633.33%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Cds
Enterprise-Grade Continuous Delivery & DevOps Automation Open Source Platform
Stars: ✭ 3,677 (+3730.21%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Jenkins
Jenkins automation server
Stars: ✭ 18,225 (+18884.38%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Gocd
Main repository for GoCD - Continuous Delivery server
Stars: ✭ 6,314 (+6477.08%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Agola
Agola: CI/CD Redefined
Stars: ✭ 783 (+715.63%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment

GitHub Slug action

Actions Status GitHub Super-Linter Public workflows that use this action. Licence

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 and trailing - character
  • limit the string size to 63 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 . is 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 _ <VAR>_CS on others variables to keep the value case-sensitive

Use this action

Add this in your workflow

- name: Inject slug/short variables
  uses: rlespinasse/[email protected]

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

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

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.

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 and forked repositories.
GITHUB_BASE_REF_SLUG GITHUB_BASE_REF The branch of the base repository.
Only set for 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

Contribute

Follow Developers guide

Troubleshooting

One of environement variable don't work as intended

Note: GitHub reserves the GITHUB_ environment variable prefix for internal use by GitHub. Setting an environment variable or secret with the GITHUB_ prefix will result in an error.

Currently, a GitHub workflow setting a GITHUB_ variable don't ended up in error. And if a custom GITHUB_ variable is in conflict with an official GITHUB_ variable, the offical GITHUB_ variable will override custom one.

Test workflow

name: Test
on: push
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - run: echo ${GITHUB_REF}
      # print "refs/heads/v3.x"
      - run: echo "GITHUB_REF=one_value" >> "$GITHUB_ENV"
      - run: echo ${GITHUB_REF}
      # print "refs/heads/v3.x"
      - run: echo "GITHUB_REF_SLUG=another_value" >> "$GITHUB_ENV"
      - run: echo ${GITHUB_REF_SLUG}
      # print "another_value"

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/[email protected]'
##[error]An action could not be found at the URI 'https://api.github.com/repos/rlespinasse/github-slug-action/tarball/master'

The master branch don't exists anymore.

The master branch EOL have been set to 2020-10-25 after a 6-month deprecation period (more information on the EOL issue)

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

Thanks for talking about us

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].