google-github-actions / google-github-actions/run-gemini-cli

Group the roles in WIF setup script

Open
#83 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/auth kind/cleanup priority/p2
Dominant language
TypeScript
Stars
2.1k
Forks
285
Avg merge
8h 8m
Merged PRs (30d)
1

Description

🟢 For better readability and maintainability, you could group these roles into an array and loop through them.

# Grant additional roles to the service account
print_info "Granting additional roles to Service Account..."
for role in \
  "roles/logging.logWriter" \
  "roles/monitoring.editor" \
  "roles/cloudtrace.agent" \
  "roles/aiplatform.user"
do
  gcloud projects add-iam-policy-binding "${GOOGLE_CLOUD_PROJECT}" \
    --role="$role" \
    --member="serviceAccount:${SERVICE_ACCOUNT_EMAIL}" \
    --condition=None
done

Originally posted by @gemini-cli[bot] in https://github.com/google-github-actions/run-gemini-cli/pull/82#discussion_r2248997889

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the WIF setup script and locate the repeated gcloud IAM role-grant commands shown in the issue. Group the four roles into a loop while preserving the existing service account, project, member, and condition arguments; done means the script grants the same roles with less repetition.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, google-cloud, shell
Domain
ci-cd, cloud, devops
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.