Skip to content

Add example showing how to pass env vars and secrets to the workflow step #40

@DeDuckProject

Description

@DeDuckProject

Problem

GitHub Actions has two distinct variable types with different syntax:

  • Secrets (sensitive): ${{ secrets.MY_SECRET }}
  • Repository variables (non-sensitive): ${{ vars.MY_VAR }}

The README doesn't show a concrete example of passing either to the git-glimpse step via env:. Users who store their preview URL as a repository variable (a natural choice since it's not sensitive) will use secrets.* by habit and get an empty string silently — which then causes a confusing downstream error.

Suggested fix

Add a snippet to the README showing both cases:

- uses: DeDuckProject/git-glimpse/packages/action@main
  env:
    ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    # Repository variable (Settings → Variables → Actions):
    PREVIEW_URL: ${{ vars.PREVIEW_URL }}
    # Secret (Settings → Secrets → Actions):
    AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}

A short note explaining the difference (vars.* vs secrets.*) would save users from a silent failure that's hard to trace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions