Skip to content

GitHub Actions

Environment Variables

Setting an environment variable (ref)

yaml
echo "{environment_variable_name}={value}" >> "$GITHUB_ENV"

Multiline strings

text
{name}<<{delimiter}
{value}
{delimiter}

yaml
steps:
  - name: Set the value in bash
    id: step_one
    run: |
      {
        echo 'JSON_RESPONSE<<EOF'
        curl https://example.com
        echo EOF
      } >> "$GITHUB_ENV"

Syntax

- name: Upload Combined Diff Output as Artifact
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: '$APP-diff-output'
          path: $(dirname "$DIFF_OUTPUT_FILE_PATH")
          # Instead of
          path: "(dirname '$DIFF_OUTPUT_FILE_PATH')"