|
пре 5 година | |
---|---|---|
.github | пре 5 година | |
__test__ | пре 5 година | |
dist | пре 5 година | |
src | пре 5 година | |
.eslintignore | пре 5 година | |
.eslintrc.json | пре 5 година | |
.gitignore | пре 5 година | |
.prettierignore | пре 5 година | |
.prettierrc.json | пре 5 година | |
CHANGELOG.md | пре 5 година | |
LICENSE | пре 5 година | |
README.md | пре 5 година | |
action.yml | пре 5 година | |
jest.config.js | пре 5 година | |
package-lock.json | пре 5 година | |
package.json | пре 5 година | |
tsconfig.json | пре 5 година |
This action checks-out your repository under $GITHUB_WORKSPACE
, so your workflow can access it.
By default, the repository that triggered the workflow is checked-out, for the ref/SHA that triggered the event.
Refer here to learn which commit $GITHUB_SHA
points to for different events.
token
in the local git configpersist-credentials: false
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.
# 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
- 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/*
The scripts and documentation in this project are released under the MIT License