|
5 anni fa | |
---|---|---|
.github | 5 anni fa | |
__test__ | 5 anni fa | |
dist | 5 anni fa | |
src | 5 anni fa | |
.eslintignore | 5 anni fa | |
.eslintrc.json | 5 anni fa | |
.gitignore | 5 anni fa | |
.prettierignore | 5 anni fa | |
.prettierrc.json | 5 anni fa | |
CHANGELOG.md | 5 anni fa | |
LICENSE | 5 anni fa | |
README.md | 5 anni fa | |
action.yml | 5 anni fa | |
jest.config.js | 5 anni fa | |
package-lock.json | 5 anni fa | |
package.json | 5 anni fa | |
tsconfig.json | 5 anni fa |
This action checks-out your repository under $GITHUB_WORKSPACE
, so your workflow can access it.
Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. Set fetch-depth
to fetch more history. Refer here to learn which commit $GITHUB_SHA
points to for different events.
The auth token is persisted in the local git config. This enables your scripts to run authenticated git commands. The token is removed during post-job cleanup. Set persist-credentials: false
to opt-out.
When Git 2.18 or higher is not in your PATH, falls back to the REST API to download the files.
path
is always relative to $GITHUB_WORKSPACEsubmodules
Refer here for previous versions.
- uses: actions/checkout@v2
with:
# Repository name with owner. For example, actions/checkout
# Default: ${{ github.repository }}
repository: ''
# The branch, tag or SHA to checkout. When checking out the repository that
# triggered a workflow, this defaults to the reference or SHA for that event.
# Otherwise, defaults to `master`.
ref: ''
# Auth token used to fetch the repository. The token is stored in the local git
# config, which enables your scripts to run authenticated git commands. The
# post-job step removes the token from the git config. [Learn more about creating
# and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
# Default: ${{ github.token }}
token: ''
# Whether to persist the token in the git config
# Default: true
persist-credentials: ''
# Relative path under $GITHUB_WORKSPACE to place the repository
path: ''
# Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching
# Default: true
clean: ''
# Number of commits to fetch. 0 indicates all history.
# Default: 1
fetch-depth: ''
# Whether to download Git-LFS files
# Default: false
lfs: ''
- uses: actions/checkout@v2
with:
ref: my-branch
- uses: actions/checkout@v2
with:
fetch-depth: 2
- run: git checkout HEAD^
- name: Checkout
uses: actions/checkout@v2
with:
path: main
- name: Checkout tools repo
uses: actions/checkout@v2
with:
repository: my-org/my-tools
path: my-tools
- name: Checkout
uses: actions/checkout@v2
- name: Checkout tools repo
uses: actions/checkout@v2
with:
repository: my-org/my-tools
path: my-tools
- name: Checkout
uses: actions/checkout@v2
with:
path: main
- name: Checkout private tools
uses: actions/checkout@v2
with:
repository: my-org/my-private-tools
token: ${{ secrets.GitHub_PAT }} # `GitHub_PAT` is a secret that contains your PAT
path: my-tools
${{ github.token }}
is scoped to the current repository, so if you want to checkout a different repository that is private you will need to provide your own PAT.
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
on:
pull_request:
branches: [master]
types: [opened, synchronize, closed]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- name: Checkout submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- uses: actions/checkout@v2
with:
token: ${{ secrets.MY_GITHUB_PAT }}
- name: Checkout submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- uses: actions/checkout@v2
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- uses: actions/checkout@v2
- run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
- uses: actions/checkout@v2
- run: |
git fetch --prune --unshallow
The scripts and documentation in this project are released under the MIT License