mirror of
https://github.com/actions/checkout.git
synced 2025-09-11 10:12:22 +08:00
Compare commits
1 Commits
335e98a846
...
dependabot
Author | SHA1 | Date | |
---|---|---|---|
|
1b0793cc05 |
@@ -17,4 +17,4 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Publish
|
- name: Publish
|
||||||
id: publish
|
id: publish
|
||||||
uses: actions/publish-immutable-action@0.0.3
|
uses: actions/publish-immutable-action@v0.0.4
|
||||||
|
2
.github/workflows/update-test-ubuntu-git.yml
vendored
2
.github/workflows/update-test-ubuntu-git.yml
vendored
@@ -48,7 +48,7 @@ jobs:
|
|||||||
|
|
||||||
# Use `docker/build-push-action` to build (and optionally publish) the image.
|
# Use `docker/build-push-action` to build (and optionally publish) the image.
|
||||||
- name: Build Docker Image (with optional Push)
|
- name: Build Docker Image (with optional Push)
|
||||||
uses: docker/build-push-action@v6.5.0
|
uses: docker/build-push-action@v6.10.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: images/test-ubuntu-git.Dockerfile
|
file: images/test-ubuntu-git.Dockerfile
|
||||||
|
27
README.md
27
README.md
@@ -33,9 +33,6 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
|
|||||||
# with the local git config, which enables your scripts to run authenticated git
|
# with the local git config, which enables your scripts to run authenticated git
|
||||||
# commands. The post-job step removes the PAT.
|
# commands. The post-job step removes the PAT.
|
||||||
#
|
#
|
||||||
# If any of the submodules are private GitHub repos, pass in a PAT with read-access
|
|
||||||
# to them.
|
|
||||||
#
|
|
||||||
# We recommend using a service account with the least permissions necessary. Also
|
# We recommend using a service account with the least permissions necessary. Also
|
||||||
# when generating a new PAT, select the least scopes necessary.
|
# when generating a new PAT, select the least scopes necessary.
|
||||||
#
|
#
|
||||||
@@ -113,8 +110,8 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
|
|||||||
# Whether to checkout submodules: `true` to checkout submodules or `recursive` to
|
# Whether to checkout submodules: `true` to checkout submodules or `recursive` to
|
||||||
# recursively checkout submodules.
|
# recursively checkout submodules.
|
||||||
#
|
#
|
||||||
# When neither the `ssh-key` nor the `token` inputs are provided, SSH URLs
|
# When the `ssh-key` input is not provided, SSH URLs beginning with
|
||||||
# beginning with `git@github.com:` are converted to HTTPS.
|
# `git@github.com:` are converted to HTTPS.
|
||||||
#
|
#
|
||||||
# Default: false
|
# Default: false
|
||||||
submodules: ''
|
submodules: ''
|
||||||
@@ -243,19 +240,12 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: my-org/my-private-tools
|
repository: my-org/my-private-tools
|
||||||
token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains a PAT with read-access to this private repository
|
token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT
|
||||||
path: my-tools
|
path: my-tools
|
||||||
```
|
```
|
||||||
|
|
||||||
## Checkout a repo and its private submodules
|
> - `${{ 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](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line).
|
||||||
|
|
||||||
```yaml
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains a PAT with read-access to the private submodules
|
|
||||||
```
|
|
||||||
|
|
||||||
## Checkout pull request HEAD commit instead of merge commit
|
## Checkout pull request HEAD commit instead of merge commit
|
||||||
|
|
||||||
@@ -321,17 +311,8 @@ jobs:
|
|||||||
git commit -m "generated"
|
git commit -m "generated"
|
||||||
git push
|
git push
|
||||||
```
|
```
|
||||||
|
|
||||||
*NOTE:* The user email is `{user.id}+{user.login}@users.noreply.github.com`. See users API: https://api.github.com/users/github-actions%5Bbot%5D
|
*NOTE:* The user email is `{user.id}+{user.login}@users.noreply.github.com`. See users API: https://api.github.com/users/github-actions%5Bbot%5D
|
||||||
|
|
||||||
# Recommended permissions
|
|
||||||
|
|
||||||
When using the `checkout` action in your GitHub Actions workflow, it is recommended to set the following `GITHUB_TOKEN` permissions to ensure proper functionality, unless alternative auth is provided via the `token` or `ssh-key` inputs:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
```
|
|
||||||
|
|
||||||
# License
|
# License
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user