Skip to content

feat: add ability to unset GITHUB_ACTION env var#225

Merged
cycjimmy merged 2 commits intocycjimmy:mainfrom
davidspek:feat/unset-gha
Mar 14, 2025
Merged

feat: add ability to unset GITHUB_ACTION env var#225
cycjimmy merged 2 commits intocycjimmy:mainfrom
davidspek:feat/unset-gha

Conversation

@davidspek
Copy link
Contributor

Type of Change

  • New feature
  • Bug fix
  • Documentation
  • Refactor
  • Chore

Resolves

Describe Changes

This PR adds the ability to unset the GITHUB_ACTIONS environment variable. In a number of scenarios it can be useful to validate a PR being merged to a branch will result in a valid release. However, due to the way the detection works in env-ci it will always pick up the branch from GitHub from environment variables that can't be overridden, even when setting ci: false. Removing the GITHUB_ACTIONS environment variable allows semantic release to pickup the branch from Git. This allows for a workflow to checkout the base branch of a PR, do a dummy merge of the PR and then run semantic release in dry-run mode to ensure a valid release would be created if the PR is merged. Such a workflow can be very helpful in environments where pre-commit hooks aren't easy to implement or desirable like open source projects.

@cycjimmy
Copy link
Owner

cycjimmy commented Jan 8, 2025

I will merge this feature into the main branch. Before doing so, can you describe the usage scenario of this parameter in the README file?

Signed-off-by: David van der Spek <david.vanderspek@flyrlabs.com>
Signed-off-by: David van der Spek <david.vanderspek@flyrlabs.com>
@davidspek
Copy link
Contributor Author

@cycjimmy Sorry for the very slow response here. I've added a section of how this can be used to the README.

@cycjimmy cycjimmy merged commit a41958e into cycjimmy:main Mar 14, 2025
4 checks passed
@cycjimmy
Copy link
Owner

Nice job. Thank you for your contributions.

@github-actions
Copy link

🎉 This PR is included in version 4.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@davidspek davidspek deleted the feat/unset-gha branch March 14, 2025 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a flag or some setting that ignores the logic for CI

2 participants