Skip to content

Cannot push changes in GitHub Actions with custom user name and password #731

Open
@Zordid

Description

@Zordid

Next issue on my journey from Jenkins to GitHub.
I need to use a different user for pushing to work around branch restrictions. As such, I have used customUsername and customPassword parameters on Jenkins.

In GH actions, I replaced the password with the token (PAT). But this does not seem to work. I cannot find a way to tell the plugin to use a PAT instead of username/password...

Any ideas?

Pushing all to remote: origin
remote message: error: GH006: Protected branch update failed for refs/heads/main.
error: Changes must be made through a pull request.

When I removed the branch protection, just to test what this would change, I see the actual commit is done using the runner user, not my other technical user I had mentioned in customUsername. So, somehow, this feature does not work with PATs...

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