• Stars
    star
    182
  • Rank 211,154 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

:octocat: ๐Ÿš€ GitHub Action for Environment Variables

:octocat: ๐Ÿš€ GitHub Environment Variables Action

GitHub Action: View on Marketplace Demo: available Version: v2.7.0 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
CI_REPOSITORY_SLUG The slug of the owner and repository name (i.e. slug of FranzDiebold/github-env-vars-action). The slug is truncated to 63 characters. franzdiebold-github-env-vars-action
CI_REPOSITORY_OWNER The owner of the repository. FranzDiebold
CI_REPOSITORY_OWNER_SLUG The slug of the owner of the repository. The slug is truncated to 63 characters. franzdiebold
CI_REPOSITORY_NAME The name of the repository. github-env-vars-action
CI_REPOSITORY_NAME_SLUG The slug of the name of the repository. The slug is truncated to 63 characters. github-env-vars-action
CI_REPOSITORY The owner and repository name. Copy of GITHUB_REPOSITORY - for reasons of completeness. FranzDiebold/github-env-vars-action
CI_REF_SLUG The slug of the branch, tag or PR number ref that triggered the workflow (i.e. slug of refs/heads/feat/feature-branch-1).
If neither a branch, tag or PR number is available for the event type, the variable will not exist. The slug is truncated to 63 characters.
refs-heads-feat-feature-branch-1 or
refs-tags-v1-3-7 or
refs-pull-42-merge
CI_ACTION_REF_NAME The branch or tag name that triggered the workflow. For pull requests it is the head branch name. feat/feature-branch-1 or
v1.3.7
CI_ACTION_REF_NAME_SLUG The slug of the branch or tag name that triggered the workflow. For pull requests it is the slug of the head branch name. The slug is truncated to 63 characters. feat-feature-branch-1 or
v1-3-7
CI_REF_NAME The branch name, tag name or PR number that triggered the workflow.
If neither a branch, tag or PR number is available for the event type, the variable will not exist.
feat/feature-branch-1 or
v1.3.7 or
42/merge
CI_REF_NAME_SLUG The slug of the branch name, tag name or PR number that triggered the workflow.
If neither a branch, tag or PR number is available for the event type, the variable will not exist. The slug is truncated to 63 characters.
feat-feature-branch-1 or
v1-3-7 or
42-merge
CI_REF The branch, tag or PR number ref that triggered the workflow.
If neither a branch, tag or PR number is available for the event type, the variable will not exist. Copy of GITHUB_REF - for reasons of completeness.
refs/heads/feat/feature-branch-1 or
refs/tags/v1.3.7 or
refs/pull/42/merge
CI_HEAD_REF_SLUG The slug of the head branch name.
Only set for event type pull request or forked repositories. The slug is truncated to 63 characters.
feat-feature-branch-1
CI_HEAD_REF Only set for forked repositories / pull request. The branch of the head repository / the head branch name. Copy of GITHUB_HEAD_REF - for reasons of completeness. feat/feature-branch-1
CI_BASE_REF_SLUG The slug of the base branch name.
Only set for event type pull request or forked repositories. The slug is truncated to 63 characters.
main
CI_BASE_REF Only set for forked repositories / pull request. The branch of the base repository / the base branch name. Copy of GITHUB_BASE_REF - for reasons of completeness. main
CI_SHA_SHORT The shortened commit SHA (8 characters) that triggered the workflow. ffac537e
CI_SHA The commit SHA that triggered the workflow. Copy of GITHUB_SHA - for reasons of completeness. ffac537e6cbbf934b08745a378932722df287a53
CI_PR_SHA_SHORT The shortened latest commit SHA in the pull request's base branch. Short version of CI_PR_SHA. Only set for pull requests. 010b249
CI_PR_SHA The latest commit SHA in the pull request's base branch. Long version of CI_PR_SHA_SHORT. Only set for pull requests. 010b2491902d50e8623934f5bc43763ff5991642
CI_PR_NUMBER The number of the pull request. Only set for pull requests. 42
CI_PR_ID Copy of CI_PR_NUMBER for completeness. 42
CI_PR_TITLE The title of the pull request. Only set for pull requests. Add feature xyz.
CI_PR_DESCRIPTION The description of the pull request. Only set for pull requests. The feature xyz is the [...]
CI_ACTOR The name of the person or app that initiated the workflow. Copy of GITHUB_ACTOR - for reasons of completeness. octocat
CI_EVENT_NAME The name of the webhook event that triggered the workflow. Copy of GITHUB_EVENT_NAME - for reasons of completeness. push or pull_request
CI_RUN_ID A unique number for each run within a repository. This number does not change if you re-run the workflow run. Copy of GITHUB_RUN_ID - for reasons of completeness. 397746731
CI_RUN_NUMBER A unique number for each run of a particular workflow in a repository. This number begins at 1 for the workflow's first run, and increments with each new run. This number does not change if you re-run the workflow run. Copy of GITHUB_RUN_NUMBER - for reasons of completeness. 73
CI_WORKFLOW The name of the workflow. Copy of GITHUB_WORKFLOW - for reasons of completeness. Demo
CI_ACTION The unique identifier (id) of the action. Copy of GITHUB_ACTION - for reasons of completeness. run2

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://docs.github.com/en/free-pro-team@latest/actions/reference/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
GITHUB_HEAD_REF Only set for forked repositories / pull request. The branch of the head repository / the head branch name. feat/feature-branch-1
GITHUB_BASE_REF Only set for forked repositories / pull request. The branch of the base repository / the base branch name. main
GITHUB_EVENT_NAME The name of the webhook event that triggered the workflow. push
GITHUB_RUN_ID A unique number for each run within a repository. This number does not change if you re-run the workflow run. 397746731
GITHUB_RUN_NUMBER A unique number for each run of a particular workflow in a repository. This number begins at 1 for the workflow's first run, and increments with each new run. This number does not change if you re-run the workflow run. 73
GITHUB_WORKFLOW The name of the workflow. Demo
GITHUB_ACTION The unique identifier (id) of the action. run2

๐Ÿš€ Example usage

steps:
  - uses: FranzDiebold/github-env-vars-action@v2
  - name: Print environment variables
    run: |
      echo "CI_REPOSITORY_SLUG=$CI_REPOSITORY_SLUG"
      echo "CI_REPOSITORY_OWNER=$CI_REPOSITORY_OWNER"
      echo "CI_REPOSITORY_OWNER_SLUG=$CI_REPOSITORY_OWNER_SLUG"
      echo "CI_REPOSITORY_NAME=$CI_REPOSITORY_NAME"
      echo "CI_REPOSITORY_NAME_SLUG=$CI_REPOSITORY_NAME_SLUG"
      echo "CI_REPOSITORY=$CI_REPOSITORY"
      echo "CI_REF_SLUG=$CI_REF_SLUG"
      echo "CI_ACTION_REF_NAME=$CI_ACTION_REF_NAME"
      echo "CI_ACTION_REF_NAME_SLUG=$CI_ACTION_REF_NAME_SLUG"
      echo "CI_REF_NAME=$CI_REF_NAME"
      echo "CI_REF_NAME_SLUG=$CI_REF_NAME_SLUG"
      echo "CI_REF=$CI_REF"
      echo "CI_HEAD_REF_SLUG=$CI_HEAD_REF_SLUG"
      echo "CI_HEAD_REF=$CI_HEAD_REF"
      echo "CI_BASE_REF_SLUG=$CI_BASE_REF_SLUG"
      echo "CI_BASE_REF=$CI_BASE_REF"
      echo "CI_SHA_SHORT=$CI_SHA_SHORT"
      echo "CI_SHA=$CI_SHA"
      echo "CI_PR_SHA_SHORT=$CI_PR_SHA_SHORT"
      echo "CI_PR_SHA=$CI_PR_SHA"
      echo "CI_PR_NUMBER=$CI_PR_NUMBER"
      echo "CI_PR_ID=$CI_PR_ID"
      echo "CI_PR_TITLE=$CI_PR_TITLE"
      echo "CI_PR_DESCRIPTION=$CI_PR_DESCRIPTION"
      echo "CI_ACTOR=$CI_ACTOR"
      echo "CI_EVENT_NAME=$CI_EVENT_NAME"
      echo "CI_RUN_ID=$CI_RUN_ID"
      echo "CI_RUN_NUMBER=$CI_RUN_NUMBER"
      echo "CI_WORKFLOW=$CI_WORKFLOW"
      echo "CI_ACTION=$CI_ACTION"

Demo

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

More Repositories

1

ng-google-sheets-db-library

Use Google Sheets as your (read-only) backend for your Angular app!
TypeScript
46
star
2

data-science-cheat-sheets

A collection of Data Science cheat sheets.
39
star
3

polars-cheat-sheet

Polars cheat sheet
HTML
31
star
4

dockerize-datascience

Dockerize Data Science
Shell
21
star
5

docker-datascience-ultimate

Customized Jupyter Spark Docker images with everything you need
Dockerfile
14
star
6

ng2d-quiz-app

A quiz app made with Angular (ng) and Google Drive (gd) ๐Ÿš€
TypeScript
7
star
7

covfefe-flow

@realDonaldTrump ๐Ÿ˜ค fake tweet autocompleter ๐Ÿค–
HTML
5
star
8

where-is-rudi

WhereIsRudi ๐Ÿถ is an interactive Slack app to inform your colleagues whether your dog@work is in the office today! ๐ŸŽ‰
Python
5
star
9

lyktos

๐Ÿ”ฑ lyktos | Compare greek and roman gods and goddesses.
JavaScript
4
star
10

numerus-textus

numerus textus is all about numbers and its corresponding texts ๐Ÿค“
TypeScript
3
star
11

plotly-express-cheat-sheet

Plotly Express cheatsheet
Jupyter Notebook
2
star
12

jazznuts-regensburg-voice-assistant

Jazznuts Regensburg - ein Sprachassistent, der dich รผber kommende und vergangene Konzerte der Jazznuts informiert.
JavaScript
2
star
13

jawsume

Use AWSume in Jupyter.
Dockerfile
2
star
14

mythology-land-alexa-skill

๐Ÿ”ฑ mythology land | an educational alexa skill about greek and roman mythology and their gods and goddesses
JavaScript
2
star
15

advent-of-code-2020

Solutions for Advent of Code 2020
Scala
1
star
16

advent-of-code-2019

Solutions for Advent of Code 2019
Scala
1
star
17

embeddings-talk

Embeddings Talk "The Wonderful World of Embeddings"
Jupyter Notebook
1
star
18

advent-of-code-2021

Solutions for Advent of Code 2021 in (Py)Spark
Jupyter Notebook
1
star
19

project-euler-solutions

Solutions for Project Euler problems
Python
1
star
20

sonatine

๐ŸŽถ A musical symbols explorer and font to easily write musical notes!
JavaScript
1
star