Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added needed call of google-github-actions/auth with credentials and changed version of google-github-actions calls #34265

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dundejan
Copy link

@dundejan dundejan commented Aug 9, 2024

Why:

Based on my own following the tutorial and usage of .github/workflows/main.yml, I found out, that there is needed to call the auth from google-github-actions for the workflow to work properly. Also the noted versions of google-github-actions were not readable, resp. their meaning was not explained and was not obvious.

When I was solving my problem, I started a discussion at community forum here: could not load the default credentials error in deploy action to GKE, where can be seen and explained the problematic part, that leads me to this little modification.

…changed version of google-github-actions calls.
Copy link

welcome bot commented Aug 9, 2024

Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Aug 9, 2024
Copy link
Contributor

github-actions bot commented Aug 9, 2024

Automatically generated comment ℹ️

This comment is automatically generated and will be overwritten every time changes are committed to this branch.

The table contains an overview of files in the content directory that have been changed in this pull request. It's provided to make it easy to review your changes on the staging site. Please note that changes to the data directory will not show up in this table.


Content directory changes

You may find it useful to copy this table into the pull request summary. There you can edit it to share links to important articles or changes and to give a high-level overview of how the changes in your pull request support the overall goals of the pull request.

Source Preview Production What Changed
actions/deployment/deploying-to-your-cloud-provider/deploying-to-google-kubernetes-engine.md fpt
ghec
ghes@ 3.14 3.13 3.12 3.11 3.10
fpt
ghec
ghes@ 3.14 3.13 3.12 3.11 3.10

fpt: Free, Pro, Team
ghec: GitHub Enterprise Cloud
ghes: GitHub Enterprise Server

@nguyenalex836 nguyenalex836 added content This issue or pull request belongs to the Docs Content team actions This issue or pull request should be reviewed by the docs actions team waiting for review Issue/PR is waiting for a writer's review and removed triage Do not begin working on this issue until triaged by the team labels Aug 9, 2024
@nguyenalex836
Copy link
Contributor

@dundejan Thanks so much for opening a PR! I'll get this triaged for review ✨

Copy link
Contributor

@janbrasna janbrasna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "unreadable" versions are required when using external actions that can change the tags pointing deliberately anywhere without the consumer knowing. Comments can be added to demonstrate what was the original tagged versions added:

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@1bee7de035d65ec5da40a31f8589e240eba8fde5
- uses: google-github-actions/setup-gcloud@v2 # or specify different version if available
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: google-github-actions/setup-gcloud@v2 # or specify different version if available
# uses: google-github-actions/setup-gcloud@v2
- uses: google-github-actions/setup-gcloud@f0990588f1e5b5af6827153b93673613abdc6ec7 # v2.1.1

@@ -172,7 +177,7 @@ jobs:
gcloud --quiet auth configure-docker

# Get the GKE credentials so we can deploy to the cluster
- uses: google-github-actions/get-gke-credentials@db150f2cc60d1716e61922b832eae71d2a45938f
- uses: google-github-actions/get-gke-credentials@v2 # or specify different version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: google-github-actions/get-gke-credentials@v2 # or specify different version
# uses: google-github-actions/get-gke-credentials@v2
- uses: google-github-actions/get-gke-credentials@6051de21ad50fbb1767bc93c11357a49082ad116 # v2.2.1

@@ -160,8 +160,13 @@ jobs:
- name: Checkout
uses: {% data reusables.actions.action-checkout %}

- name: Authenticate with Google Cloud
uses: google-github-actions/auth@v1 # or specify different version if available
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: google-github-actions/auth@v1 # or specify different version if available
# uses: google-github-actions/auth@v2
uses: google-github-actions/auth@f112390a2df9932162083945e46d439060d66ec2 # v2.1.4

- name: Authenticate with Google Cloud
uses: google-github-actions/auth@v1 # or specify different version if available
with:
credentials_json: ${{ secrets.GKE_SA_KEY }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work as demonstrated in previews, needs escaping:

Suggested change
credentials_json: ${{ secrets.GKE_SA_KEY }}
credentials_json: {% raw %}${{ secrets.GKE_SA_KEY }}{% endraw %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team waiting for review Issue/PR is waiting for a writer's review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants