Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(GitHub) Default env vars naming #994

Open
1 task done
mateusz-was opened this issue Jan 2, 2025 · 1 comment
Open
1 task done

(GitHub) Default env vars naming #994

mateusz-was opened this issue Jan 2, 2025 · 1 comment
Assignees
Labels
integration Related to remote integration

Comments

@mateusz-was
Copy link

mateusz-was commented Jan 2, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

Hi!

This is more 'quality-of-life' enhancement rather than bug, bug I guess it might be helpful...

There are 2 sets naming standards for default GitHub env var values:

  1. GitHub CLI values (prefixed GH_): https://cli.github.com/manual/gh_help_environment
  2. Default env vars set by GitHub in Actions (prefixed GITHUB_): https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables

For default repository value git-cliff uses GITHUB_REPO which doesn't fall inline with any of the above.
GH_REPO is used in 1) and GITHUB_REPOSITORY is used in 2)

This can be confusing when you use git-cliff in GitHub Actions for the first time (directly from CLI, without https://github.com/orhun/git-cliff-action).

Steps To Reproduce

  1. Setup GitHub Action pipeline
jobs:
  generate-changelog:
    name: Generate changelog
    runs-on: linux
    steps:
    - name: Checkout
      uses: actions/checkout@v3
      with:
        fetch-depth: 0
        token: '${{ secrets.GIT_CLIFF_PAT }}'
    - name: Install git-cliff
      run: pip install git-cliff
    - name: Render changelog
      run: |
        env | grep GITHUB
        git cliff -v --github-repo=$GITHUB_REPOSITORY --github-token=${{ secrets.GIT_CLIFF_PAT }}` 

Expected behavior

--github-repo=$GITHUB_REPOSITORY should be obsolete and it's value taken from existing GITHUB_REPOSITORY default env variable for better user experience

Screenshots / Logs

No response

Software information

  • Operating system: GitHub Actions
  • Rust version: - (used from PyPI)
  • Project version: 2.7.0

Additional context

This hurt me more, because there was GITHUB_REPO variable set in my company's GHE server. It was pointing to some GitHub Actions configuration repository. I spend an hour to find why the API call were failing 🤷‍♂️

@mateusz-was mateusz-was added the integration Related to remote integration label Jan 2, 2025
Copy link

welcome bot commented Jan 2, 2025

Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration Related to remote integration
Projects
None yet
Development

No branches or pull requests

2 participants