Skip to content

Commit cb40def

Browse files
authored
docs: add warning about using checkout action before login-to-gar (#1012)
Add warning about using checkout before login-to-gar
1 parent 7624f0a commit cb40def

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

actions/login-to-gar/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ jobs:
3535
| `registry` | Google Artifact Registry to authenticate against. | `us-docker.pkg.dev` |
3636
| `environment` | Environment for pushing artifacts (can be either dev or prod). | `dev` |
3737
| `delete_credentials_file` | Delete the credentials file after the action is finished. If you want to keep the credentials file for a later step, set this to false. | `false` |
38+
39+
> [!WARNING]
40+
> When using the `login-to-gar` action in GitHub Actions workflows, always place the `checkout` action before it. This is because the `login-to-gar` action stores Docker credentials in the workspace, and these credentials would be lost if the workspace is overwritten by a subsequent `checkout` action. The correct order makes sure that the Docker credentials persist throughout the workflow.

0 commit comments

Comments
 (0)