The Simplest Way to Make GitHub Actions and Google Workspace Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair github actions and google workspace to automate user changes and group updates from code. This setup lets pipelines check identity rules and run admin tasks without manual clicks. Engineering teams often manage email groups, drive folders, and team rosters in code. When a developer merges a pull request, the workflow runs and updates the directory. This approach keeps user lists accurate and gives every change a clear git history. How github actions and google workspace share ident

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams pair github actions and google workspace to automate user changes and group updates from code. This setup lets pipelines check identity rules and run admin tasks without manual clicks.

Engineering teams often manage email groups, drive folders, and team rosters in code. When a developer merges a pull request, the workflow runs and updates the directory. This approach keeps user lists accurate and gives every change a clear git history.

How github actions and google workspace share identity and data

To link github actions and google workspace, you must set up trust between both systems. In the past, teams created static service account keys and saved them as repo secrets. Static keys never expire on their own and create high risk if someone steals them.

Modern setups use OpenID Connect to trade short tokens instead of saving long keys. When a job starts, the runner asks for a signed token from the code host. Google Cloud checks this token against a trust rule that you set up in advance.

Once the cloud project trusts the runner, the job takes on a cloud service account. That service account then uses domain delegation or directory roles to call the admin APIs. Data flows over TLS from the runner to the directory API and back again.

You can scope the trust rule to one repo, one branch, or one job state. This stops a test branch from running changes meant only for the main branch. Each step checks the caller identity before any directory data moves across the network.

Common failure modes and how to scope roles

The biggest mistake is giving the service account full super admin rights in the directory. If an attacker changes the workflow file, they can take over the whole company domain. Domain delegation is also risky because it lets the account act as any real user.

Instead, assign a custom admin role directly to the service account in the admin console. Give that role only the exact rights it needs, such as reading or updating groups. Avoid domain delegation unless your workflow must touch user mail or calendar items.

GitHub Actions Security + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Shared service accounts across many repos also cause trouble during audits and security reviews. If ten workflows share one identity, you cannot tell which job made a bad change. Create one dedicated service account for each workflow so every log entry is clear.

Another common gap is missing audit logs for data reads and group changes. Directory logs show that a service account ran a call, but not which git commit triggered it. Teams should pass the commit hash or run ID into request labels when possible.

Designing safe approval flows for directory changes

Automated jobs should not change high-risk admin groups without a human check first. You can set up protected deployment rules inside your repo to pause the job. A security lead must review the plan and approve the run before the API call happens.

Keep your directory code split into a dry run step and an apply step. The dry run runs on every pull request and shows what groups will change. The apply step runs only after merge and uses a distinct, higher role.

This split design keeps read keys separate from write keys at all times. Even if a bad pull request runs, the job can only read group names. Write rights stay locked behind branch rules and team approvals.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Yes, you can use OpenID Connect federation through a Google Cloud project. The workflow trades a temporary job token for a short-lived cloud token at runtime.

Do I need domain delegation to manage directory groups from a workflow?

No, you do not need domain delegation for basic group or user tasks. You can assign a scoped custom admin role directly to the cloud service account.

How do I stop pull requests from making live directory changes?

Restrict your cloud trust policy so only the main branch can assume the write role. Use a separate read-only role for jobs that run on open pull requests.

The query runs. The emails stay hidden.