Skip to content

Stop accessing GITHUB_TOKEN under the hood in github_helper #416

@mokagio

Description

@mokagio

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.

'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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions