The Simplest Way to Make Gitea and Step Functions Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair Gitea and Step Functions to trigger cloud workflows from code events. When developers push code to Gitea, outbound webhooks start state machines in AWS. This workflow turns basic repo events into multi-step cloud jobs. You can run tests, build images, and update servers in order. Gitea holds the source code and tracks changes for your team. Step Functions coordinates the cloud tasks and handles retries when steps fail. How Gitea and Step Functions share data and permissions The li

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 Gitea and Step Functions to trigger cloud workflows from code events. When developers push code to Gitea, outbound webhooks start state machines in AWS.

This workflow turns basic repo events into multi-step cloud jobs. You can run tests, build images, and update servers in order. Gitea holds the source code and tracks changes for your team. Step Functions coordinates the cloud tasks and handles retries when steps fail.

How Gitea and Step Functions share data and permissions

The link between Gitea and Step Functions starts with an outbound event. A developer merges a pull request or pushes a new git tag. Gitea packages this event into a small JSON payload. It sends the payload over HTTPS to an AWS endpoint.

Gitea cannot call a state machine with a raw webhook alone. AWS needs a signed request before it starts any job. Most teams place an API endpoint or event bus in front. That receiver checks the webhook secret from Gitea first.

Next, the receiver uses an AWS role to start the state machine. It passes the git commit hash, branch name, and author details forward. Each step in the workflow reads only the fields it needs. If a build task needs source code, it fetches that commit from Gitea.

At the end of the run, the workflow reports status back to Gitea. A final step sends a status update to the Gitea commit API. Developers see a green check or red cross right on their pull request.

Common failure modes and how to scope roles

Many teams rush the setup and use shared static keys. They create one admin user in Gitea for all cloud tasks. Then they store a long-lived AWS key inside Gitea settings. If that key leaks, an attacker can run any cloud state machine.

Broad tokens cause another major risk for engineering teams. A single token with full write rights can delete code repos. It can also push bad code into main branches without review. When every workflow shares one token, your logs lose clarity. You cannot tell which state machine changed a repo.

Cloud Functions IAM + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Unlogged calls between the two tools also slow down incident response. If a webhook fails in transit, the workflow never starts. Without clear logs at both ends, engineers waste hours guessing why. You need strict timeouts and retry rules on every step.

To fix this, scope each role to one small job. Give the webhook receiver permission to start only one specific state machine. Use short-lived roles inside AWS instead of static keys. In Gitea, issue fine-grained tokens scoped to single repos and read-only actions.

Network paths and data hygiene between systems

Keep the network path between your git server and cloud workflows tight. If Gitea runs in a private network, keep traffic off public routes. Use private endpoints so webhook data stays inside your cloud network. Check the webhook signature on every single request before parsing data.

Be careful with the data you pass into state machine inputs. Commit messages and branch names can hold sensitive details by mistake. A developer might paste emails or phone numbers into a commit note. Step Functions logs every input and output payload during a run. Scrub or mask card numbers and national IDs before they enter logs. Masking rewrites matched fields in results so sensitive strings stay safe.

Keep payloads small by passing references instead of full files. Send the commit hash and repo name in the webhook event. Let individual tasks pull the exact files they need during execution. This keeps state machine history clean and avoids payload size limits.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Can Gitea trigger a state machine without an AWS key?

Gitea webhooks only send standard HTTP requests with a secret header. You need an AWS endpoint in front to verify that secret and assume an IAM role.

How should Step Functions authenticate back to Gitea?

Create a dedicated bot account in Gitea with read-only or status-only permissions. Store its token in a cloud secret store and fetch it during the run.

What data should we exclude from state machine payloads?

Never pass raw secrets, private keys, or full user records in webhook payloads. Pass only commit hashes, branch names, and repo identifiers needed for the job.

The query runs. The emails stay hidden.