Skip to content

feature: add action to trigger gcp workflows - #2

Merged
dudizimber merged 3 commits into
mainfrom
1-feature-add-action-to-trigger-gcp-workflows
Oct 5, 2025
Merged

feature: add action to trigger gcp workflows#2
dudizimber merged 3 commits into
mainfrom
1-feature-add-action-to-trigger-gcp-workflows

Conversation

@dudizimber

Copy link
Copy Markdown
Owner

fix #1

This pull request introduces the initial release of the GCP Workflows action, providing a robust solution for executing Google Cloud Workflows in response to Prometheus alerts. The changes include a production-ready Dockerfile, comprehensive documentation, example configurations for both static and dynamic workflow execution, a full test suite, and all necessary dependencies. Key features support both service account and Workload Identity authentication, flexible workflow name resolution, secure containerization, and extensive configuration options.

Core Features and Implementation:

  • Initial release with static and dynamic workflow name support, alert data passed as JSON, GCP authentication via service account or Workload Identity, configurable execution timeout, workflow completion monitoring, workflow name sanitization, structured logging, non-root user execution, and example configurations. (actions/gcp-workflows/CHANGELOG.md)

Containerization and Security:

  • Production Dockerfile with multi-stage build, Alpine-based runtime for minimal attack surface, and non-root execution (UID 1001). (actions/gcp-workflows/Dockerfile)

Documentation and Examples:

  • Example AlertReaction manifests for static workflow execution with service account authentication, dynamic workflow execution with Workload Identity, and workflow name extraction from alert annotations. (actions/gcp-workflows/examples/static-workflow-alertreaction.yaml, actions/gcp-workflows/examples/dynamic-workflow-workload-identity.yaml, actions/gcp-workflows/examples/workflow-from-annotation.yaml) [1] [2] [3]

Testing and Validation:

  • Comprehensive test script covering unit tests, configuration validation, workflow name resolution, JSON parsing, environment variable fallbacks, timeout/wait handling, default configurations, and field extraction logic. (actions/gcp-workflows/test.sh)

Dependencies:

  • Go module definition including required GCP and logging libraries for workflow execution and authentication. (actions/gcp-workflows/src/go.mod)

- Implemented static workflow example in YAML configuration for alert reactions.
- Added dynamic workflow execution based on alert annotations.
- Introduced Go module for GCP Workflows with necessary dependencies.
- Developed main application logic to handle alert data and execute workflows.
- Created comprehensive test script to validate configuration and functionality.
- Ensured environment variable fallbacks for alert data and workflow names.
- Added sanitization for workflow names to comply with GCP naming requirements.
… variable mappings and workflow name sanitization
Copilot AI review requested due to automatic review settings October 5, 2025 08:04
@dudizimber dudizimber linked an issue Oct 5, 2025 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces the initial release of the GCP Workflows action, providing a robust solution for executing Google Cloud Workflows in response to Prometheus alerts. The action supports both static and dynamic workflow name resolution, comprehensive authentication methods, and secure containerization.

Key features include:

  • Static and dynamic workflow name support with automatic sanitization
  • GCP authentication via service account keys or Workload Identity
  • Comprehensive alert data passing and flexible configuration options

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
actions/gcp-workflows/src/main.go Core Go application implementing workflow execution logic and alert data processing
actions/gcp-workflows/src/go.mod Go module definition with GCP Workflows and authentication dependencies
actions/gcp-workflows/test.sh Comprehensive test script covering configuration validation and workflow name resolution
actions/gcp-workflows/Dockerfile Multi-stage Docker build with Alpine runtime and non-root execution
actions/gcp-workflows/README.md Complete documentation with usage examples and authentication setup
actions/gcp-workflows/CHANGELOG.md Initial release changelog documenting all features
actions/gcp-workflows/examples/*.yaml Example AlertReaction configurations for different authentication methods
actions/gcp-workflows/examples/setup-gcp.sh GCP setup script for automated resource provisioning

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread actions/gcp-workflows/src/main.go Outdated
Comment thread actions/gcp-workflows/src/main.go
@dudizimber
dudizimber merged commit b538863 into main Oct 5, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: add action to trigger gcp workflows

2 participants