-
Notifications
You must be signed in to change notification settings - Fork 9
Description
I just experienced a CI failure while my automation attempted to create a GitHub release for an internal app. The reason for the failure was a 401 from the GitHub API. This happened because neither GHHELPER_ACCESS nor GITHUB_TOKEN were available in the environment at runtime.
release-toolkit/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb
Lines 13 to 14 in 24d6859
| 'GHHELPER_ACCESS', # For historical reasons / backward compatibility | |
| 'GITHUB_TOKEN', # Used by the `gh` CLI tool |
While I agree that it's convenient to not have to pass tokens around when calling helper methods, by accessing them under the hood we make them invisible to our consumers, which can lead to issues such as the one I just experienced.
I think we'd be better off incurring a more verbose API in the actions by adding parameters for all the tokens they expect, rather than risking CI failures like this one.
Case in point, I had already experience a CI failure because of a missing token and grepped the Fastfile of that project for any ENV access that would reveal the need for others. Had create_release required an explicit token, I would have seen it and added it to our CI environment before retrying my deployment build.