Skip to content
terminal

GitHub Action

SSH to HTTPS action

v1 Latest version

SSH to HTTPS action

terminal

SSH to HTTPS action

Github Action to reconfigure git to use HTTPS authentication instead of SSH

Installation

Copy and paste the following snippet into your .yml file.

              

- name: SSH to HTTPS action

uses: GuillaumeFalourd/SSH-to-HTTPS@v1

Learn more about this action in GuillaumeFalourd/SSH-to-HTTPS

Choose a version

SSH-to-HTTPS

Action test on Ubuntu Action test on MacOS Action test on Windows

Github Action to reconfigure git to use HTTPS authentication instead of SSH (which is used by default in the runner configuration).

Kudos: This action implementation is based on this comment on the actions/setup-node.

📚 Usage

Requirements

⚠️ The actions/checkout is mandatory to use this action, with persist-credentials: false.

Action inputs

Field Mandatory Observation
github_token NO How to create a PAT

Without Github PAT

      - name: Checkout
        uses: actions/[email protected]
        with:
          persist-credentials: false

      - name: Reconfigure git to use HTTPS authentication
        uses: GuillaumeFalourd/SSH-to-HTTPS@v1

With Github PAT

      - name: Checkout
        uses: actions/[email protected]
        with:
          persist-credentials: false

      - name: Reconfigure git to use HTTPS authentication
        uses: GuillaumeFalourd/SSH-to-HTTPS@v1
        with:
          github_token: ${{ secrets.ACCESS_TOKEN }}

Note: You can use the default ${{ secrets.GITHUB_TOKEN }} or your PAT with ${{ secrets.ACCESS_TOKEN }}.

Eventual security concerns

There is no difference in terms of transport security, HTTPS and SSH rely on similar underlying crypto.

Persisting your credentials by adding your secret Personal Access Token (PAT) to the global git config does have security implications, but it's the default behavior of the checkout action already (using persist-credentials: true) so no security is "lost".

If you don't want the PAT hanging around, run some form of post-job cleanup.

🤝 Contributing

Guidelines

🏅 Licensed

☞ This repository uses the Apache License 2.0