name: "GitHub Slug Action" description: "GitHub Action to expose slug value of environment variables inside your GitHub workflow" author: "Romain Lespinasse" branding: icon: "minimize" color: "blue" inputs: prefix: description: "Value to prepend to each generated variable" default: "" required: false slug-maxlength: description: "Max length of the slugified values" default: "63" required: true short-length: description: "Length of the shortify values (git default if empty)" required: false runs: using: "composite" steps: - run: $GITHUB_ACTION_PATH/preflight.sh id: prefligth shell: bash env: INPUT_SLUG_MAXLENGTH: ${{ inputs.slug-maxlength }} INPUT_SHORT_LENGTH: ${{ inputs.short-length }} # From Environment Variables, Specific values and Calculated values # Consolidated into a single step to avoid the runner printing a # repeated "env:" dump for every shell run step (see issue #161). - run: $GITHUB_ACTION_PATH/slugify-env.sh id: slugify-env shell: bash env: INPUT_PREFIX: ${{ inputs.prefix }} INPUT_SLUG_MAXLENGTH: ${{ inputs.slug-maxlength }} INPUT_GITHUB_REPOSITORY: ${{ github.repository }} INPUT_GITHUB_EVENT_REF: ${{ github.event.ref }} INPUT_GITHUB_REF_NAME: ${{ github.ref_name }} GITHUB_HEAD_REF: ${{ github.head_ref }} # From sha - uses: rlespinasse/shortify-git-revision@c90ba7007ef6c152254d10b9f1a327966ab13077 # v1.6.0 with: name: GITHUB_SHA short-on-error: true length: ${{ steps.prefligth.outputs.PREFLIGHT_SHORT_LENGTH }} prefix: ${{ inputs.prefix }} - uses: rlespinasse/shortify-git-revision@c90ba7007ef6c152254d10b9f1a327966ab13077 # v1.6.0 with: name: GITHUB_EVENT_PULL_REQUEST_HEAD_SHA revision: ${{ github.event.pull_request.head.sha }} short-on-error: true length: ${{ steps.prefligth.outputs.PREFLIGHT_SHORT_LENGTH }} prefix: ${{ inputs.prefix }}