Git Product home page Git Product logo

action-git-auth's Introduction

open-turo/action-git-auth

This GitHub Action provides a way to configure credentials for any utility that uses the git command, or any utility that uses the git command as a subprocess, or any utility that uses the git configuration file in its authentication and cloning.

Authenticates using URL patterns that match https://server/prefix*. If no matching URL exists, the action will not use the authentication credentials presented via the github-personal-access-token input.

See here for some additional background on git config as it relates to the problem this action is solving, and here for general reference on git config from the official git documentation.

Release Tests pass/fail License Contributions welcome CI Coverage Status semantic-release: angular Conventional commits Join us!

Usage

Authenticate using default URL of https:///*

jobs:
    checkout:
        runs-on: ubuntu-latest
        steps:
            - name: Authorize
              uses: open-turo/action-git-auth@v2
              with:
                  github-personal-access-token:
                      ${{ secrets.PERSONAL_ACCESS_TOKEN }}

Authenticate using server specific URL of https://githubenterprise.examplecompany.com/*

jobs:
    checkout:
        runs-on: ubuntu-latest
        steps:
            - name: Authorize
              uses: open-turo/action-git-auth@v2
              with:
                  server: githubenterprise.examplecompany.com
                  github-personal-access-token:
                      ${{ secrets.PERSONAL_ACCESS_TOKEN }}

Authenticate using server and prefix specific URL of https://git.example.com/github-org\*

jobs:
    checkout:
        runs-on: ubuntu-latest
        steps:
            - name: Authorize
              uses: open-turo/action-git-auth@v2
              with:
                  server: git.example.com
                  prefix: github-org
                  github-personal-access-token:
                      ${{ secrets.PERSONAL_ACCESS_TOKEN }}

Inputs

parameter description required default
github-personal-access-token A GitHub personal access token that has appropriate access in the consumer GitHub repository that will be used for authentication with GitHub. true
prefix The prefix to use for the URL path rewrite. This will often be an organization name if you wish to limit which repositories are accessible. false
server The name of the GitHub server to use, if not using hosted. This is useful if you are running this action against a GitHub Enterprise instance. false

Runs

This action is an node16 action.

Development

This section describes how to develop the project.

Testing

In order to run tests for local development, first run npm install to download dependencies, and then run npm test to run the test suite. This library uses jest for its test suite.

Packaging

In order for GitHub Actions to use this library, it must be packaged into the dist/ directory. As part of any pull request which changes the library, this should be run.

Run prepare:

npm run prepare  # Generate the dist/ files
git add dist/  # Add the dist/ files to the commit

Releasing

Releases are created according to the Semantic Versioning process. We also use the Conventional Commits messages to determine what the release version is.

Once a PR has been merged, the repository maintainer is responsible for creating a new release, as well as moving the floating release tag to the new commit.

Get Help

Please review Issues, post new Issues against this repository as needed.

Contributions

Please see here for guidelines on how to contribute to this project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.