Ability to detect that updates are running in a dependabot environment
rohitpaulk opened this issue · comments
Is there a way to recognize whether an update is running on Dependabot? An environment variable, maybe?
For context, here's what we're trying to achieve:
Our applications need a custom version number to be bumped on every PR that requires a deploy. We want all dependabot PRs to be of this kind, so we've added a postinstall
script that bumps the version. Currently, the post install script just checks if yarn.lock
has changed, and updates the application version if so. We don't want said script to run in development or other areas though, it is intended for dependabot PRs only. That's where the need arises.
If it helps, we're using yarn/npm.
Maybe looking at the branch name would work? 🤔
@rohitpaulk ah, unfortunately, this won't work as we disable all install hooks from running. I've seen some users do something similar using GitHub Actions targeting the dependabot branch name and updating the pull request with a new commit.
Ah. If install hooks don't run at all, I guess this issue doesn't really make sense - closing. Thanks for the answer & suggestion!