Skip to content

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

License

Notifications You must be signed in to change notification settings

GuillaumeFalourd/SSH-to-HTTPS

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks