Skip to content

Support HTTPS + token pushes (CI-friendly; prerequisite for scheduled runs) #75

Description

@silug

Problem

puppetsync pushes over SSH: git_push_to_remote runs git push <remote> against the fork's ssh_url (set up by ensure_git_remote from user_repo_fork.ssh_url), which requires a working ssh-agent. That's fine interactively, but it's the last blocker for running puppetsync unattended (#56): CI runners and scheduled jobs have a GITHUB_API_TOKEN, not an SSH identity.

This has been a stretch-goal TODO in plans/init.pp for years:

# - [ ] push changes using HTTPS basic auth + GitHub token (CI friendly)

Proposed design

  • ensure_git_remote gains a transport choice: when git.push_transport: https (session config; default remains ssh), use the fork's clone_url (https://github.com/<user>/<repo>.git) as the remote URL.

  • The push itself authenticates with the existing GITHUB_API_TOKEN without writing the token to disk or the remote URL — e.g.:

    git -c credential.helper='!f() { echo username=x-access-token; echo password=$GITHUB_API_TOKEN; }; f' push ...
    

    (env-var indirection keeps the token out of process listings and .git/config).

  • Nothing else changes: fork creation, PR creation, and the approve/merge plans already use the API token.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions