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

Closed
wants to merge 1 commit into 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 %}

@subatoi subatoi added the needs SME This proposal needs review from a subject matter expert label Sep 17, 2024
Copy link
Contributor

Thanks for opening a pull request! We've triaged this issue for technical review by a subject matter expert 👀

@nguyenalex836
Copy link
Contributor

@dundejan Thank you for your patience while our team reviewed! ✨ Before we make these changes to the docs, have you
by chance reached out to our support team regarding the behavior you saw with the workflow?

Ideally, we would want them to have a chance to dive into this issue before we make any modifications to the docs 💛

@nguyenalex836 nguyenalex836 added more-information-needed More information is needed to complete review and removed waiting for review Issue/PR is waiting for a writer's review needs SME This proposal needs review from a subject matter expert labels Sep 27, 2024
@janbrasna
Copy link
Contributor

FYI there's a similar update from Google Cloud staff last month, adding the auth in the starter workflow too: https://github.com/actions/starter-workflows/pull/2478/files#diff-92b5bbe29dbd8d2c6ae67ce2e24b44e8a82f6c5b00702b05e78cdaaf4f269662

It may however need a more systematic approach updating all the google-cloud-* examples throughout the site, though:/

@github-actions github-actions bot added the stale There is no recent activity on this issue or pull request label Oct 7, 2024
Copy link
Contributor

github-actions bot commented Oct 7, 2024

This PR has been automatically closed because there has been no response to to our request for more information from the original author. Please reach out if you have the information we requested, or open a new issue to describing your changes. Then we can begin the review process.

@github-actions github-actions bot closed this Oct 7, 2024
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 more-information-needed More information is needed to complete review stale There is no recent activity on this issue or pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants