Giter Club home page Giter Club logo

github-env-vars-action's Introduction

:octocat: ๐Ÿš€ GitHub Environment Variables Action

GitHub Action: View on Marketplace Demo: available Version: v1.2.1 Lint and Test license: MIT

A GitHub Action to expose useful environment variables.

Environment Variables exposed by this Action

Environment Variable Name Description Example value
GITHUB_REPOSITORY_SLUG The slug of the owner and repository name (i.e. slug of FranzDiebold/github-env-vars-action). franzdiebold-github-env-vars-action
GITHUB_REPOSITORY_OWNER The owner of the repository. FranzDiebold
GITHUB_REPOSITORY_OWNER_SLUG The slug of the owner of the repository. franzdiebold
GITHUB_REPOSITORY_NAME The name of the repository. github-env-vars-action
GITHUB_REPOSITORY_NAME_SLUG The slug of the name of the repository. github-env-vars-action
GITHUB_REF_SLUG The slug of the branch or tag ref that triggered the workflow (i.e. slug of refs/heads/feat/feature-branch-1).
If neither a branch or tag is available for the event type, the variable will not exist.
refs-heads-feat-feature-branch-1
GITHUB_REF_NAME The branch or tag name that triggered the workflow.
If neither a branch or tag is available for the event type, the variable will not exist.
feat/feature-branch-1
GITHUB_REF_NAME_SLUG The slug of the branch or tag name that triggered the workflow.
If neither a branch or tag is available for the event type, the variable will not exist.
feat-feature-branch-1
GITHUB_SHA_SHORT The shortened commit SHA (8 characters) that triggered the workflow. ffac537e

The slugified values are designed to be used in a URL.

Default Environment Variables exposed by GitHub

For a full list of default environment variables exposed by GitHub see https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables.

Environment Variable Name Description Example value
GITHUB_ACTOR The name of the person or app that initiated the workflow. octocat
GITHUB_REPOSITORY The owner and repository name. FranzDiebold/github-env-vars-action
GITHUB_SHA The commit SHA that triggered the workflow. ffac537e6cbbf934b08745a378932722df287a53
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.
refs/heads/feat/feature-branch-1

๐Ÿš€ Example usage

steps:
  - uses: FranzDiebold/[email protected]
  - name: Print environment variables
    run: |
      echo "GITHUB_REPOSITORY_SLUG=$GITHUB_REPOSITORY_SLUG"
      echo "GITHUB_REPOSITORY_OWNER=$GITHUB_REPOSITORY_OWNER"
      echo "GITHUB_REPOSITORY_OWNER_SLUG=$GITHUB_REPOSITORY_OWNER_SLUG"
      echo "GITHUB_REPOSITORY_NAME=$GITHUB_REPOSITORY_NAME"
      echo "GITHUB_REPOSITORY_NAME_SLUG=$GITHUB_REPOSITORY_NAME_SLUG"
      echo "GITHUB_REF_SLUG=$GITHUB_REF_SLUG"
      echo "GITHUB_REF_NAME=$GITHUB_REF_NAME"
      echo "GITHUB_REF_NAME_SLUG=$GITHUB_REF_NAME_SLUG"
      echo "GITHUB_SHA_SHORT=$GITHUB_SHA_SHORT"

Demo

A demo for all Operating systems (Linux, macOS and Windows) is also available in the demo workflows file of this repository!

github-env-vars-action's People

Contributors

franzdiebold avatar parthopdas avatar priyankasaggu11929 avatar

Watchers

 avatar  avatar

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.