-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit db53230
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Copyright 2021 albelli BV | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# SparseCheckout-Action | ||
|
||
A GitHub Action to perform a [sparse checkout with git](https://git-scm.com/docs/git-sparse-checkout). | ||
|
||
## Usage | ||
``` | ||
- uses: albumprinter/SparseCheckout-Action@v1 | ||
with: | ||
paths: config src/core tests/unit | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Sparse checkout: https://github.com/actions/checkout/issues/172 | ||
# actions/checkout@v2 does not support sparse checkout as of Oct 2021 | ||
|
||
name: Sparse checkout | ||
inputs: | ||
token: | ||
description: 'GitHub token' | ||
default: ${{ github.token }} | ||
|
||
paths: | ||
description: 'Paths to add to the sparse checkout' | ||
required: true | ||
type: string # There is no type "list" in Github Actions as of Oct 2021 | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Perform sparse checkout | ||
shell: bash | ||
run: | | ||
REPO="https://${GITHUB_ACTOR}:${{ inputs.token }}@github.com/${GITHUB_REPOSITORY}.git" | ||
# For a partial checkout we need a branch name (like issue/APP-XXXX) | ||
# Now, follow the hands: | ||
# GITHUB_HEAD_REF is defined only for pull_request triggers and it's a branch name | ||
# GITHUB_REF is defined only for branch push triggers and it's a ref (ref/heads/issue/APP-XXXX) | ||
PR_BRANCH=${GITHUB_HEAD_REF} | ||
PUSH_BRANCH=${GITHUB_REF#refs/heads/} | ||
BRANCH="${PR_BRANCH:-${PUSH_BRANCH}}" # Pick one of the two | ||
git clone --filter=blob:none --no-checkout --depth 1 --single-branch -b "$BRANCH" --sparse "$REPO" . | ||
git sparse-checkout init --cone | ||
git sparse-checkout add ${{ inputs.paths }} | ||
git checkout |