GithubHelp home page GithubHelp logo

rohmanngmbh / action-checkout-repo Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 94 KB

Github action to checkout a repository with: folder, submodules, git lfs and alternative reference options

License: MIT License

Python 100.00%
action checkout submodules reference actions alternative git lfs pygithub python

action-checkout-repo's Introduction

GitHub action: checkout

It's based on Base Checkout Action and Cached LFS Checkout Action.

We added a special reference handling called "alt_ref". This feature we need in case of a multi-repo build chain in case of mirror branches. If the feature branch does not exist in your repository, the alternative reference 'alt_ref' will be taken. To handle the reference stuff we are using PyGithub.

You can set regular expression to checkout reference, too.

Check this out on Github Marketplace.

Hint(s):

  • Windows did not use an own virtual environment (python)
  • This works only for GitHub Repos
  • local files will be checked out to folder .temp

Options

This action supports:

  • checkout to a special folder / path
  • submodules
  • git lfs (in cached mode)
  • select a special reference
  • select a alternative reference (used when your regular reference does not exist)
  • select a reference with regular expression e.g like */release/*.*.* (and get the last matching, in case of downgrade you get the )

Examples:

Checkout a special branch

- name: Checkout repo with a special branch
  uses: rohmanngmbh/[email protected]
  with:
    ref: my-branch

Checkout private repo

- name: Checkout private repo
  uses: rohmanngmbh/[email protected]
  with:
    repository: my-org/my-private-repo
    token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT
    path: my-repo

## GIT LFS repo
```yaml
- name: Checkout git lfs repo
  uses: rohmanngmbh/[email protected]
  with:
    lfs: true

This uses a regular checkout like Cached LFS Checkout Action.

Checkout repo with submodules

If you want to use LFS use:

- name: Checkout repo with submodules
  uses: rohmanngmbh/[email protected]
  with:
    submodules: recursive

Checkout a special branch with fallback alternative

- name: Checkout repo with alternative ref
  uses: rohmanngmbh/[email protected]
  with:
    ref: feature/blue-light
    alt_ref: develop

Checkout the last tag with a regular expression

- name: Checkout repo with alternative ref
  uses: rohmanngmbh/[email protected]
  with:
    ref: */release/*.*.* 

Checkout the last tag with a regular expression and not matching to default branch

- name: Checkout repo with alternative ref
  uses: rohmanngmbh/[email protected]
  with:
    ref: */release/*.*.* 
    regex_next_to_last: true

Checkout one repository with different 'states' to check up and downgrade mechanism

- name: Checkout to update folder
  uses: rohmanngmbh/action-checkout-repo@main
  with:
    path: update
    lfs: true
    ref: ${{ github.ref }}

- name: Checkout to downgrade folder
  uses: rohmanngmbh/action-checkout-repo@main
  with:
    path: downgrade
    lfs: true
    ref: project/release/*
    regex_next_to_last: true

License

The scripts and documentation in this project are released under the MIT License.

Support OS

Test

  • ubuntu-22.04 (ubuntu-latest)
  • windows-2022 (windows-latest)
  • macos-12 (macos-latest)

action-checkout-repo's People

Contributors

bauergeorg avatar dependabot[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

action-checkout-repo's Issues

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.