A simple Go application with GitHub Actions workflows demonstrating CI/CD and ChatOps slash commands.
This repository contains a basic "Hello, World!" Go application.
go run main.gogo build -v ./...go test -v ./...Located at .github/workflows/build.yaml, this workflow runs automatically on:
- Push to
mainbranch - Pull requests to
mainbranch
It performs three jobs in parallel:
- Build: Compiles the Go application
- Test: Runs all tests
- Lint: Runs golangci-lint for code quality
This repository implements slash commands for pull requests, similar to tektoncd/pipeline.
Comment on a pull request with these commands:
/retest- Reruns failed GitHub Actions checks for the PR/build- Triggers an on-demand build and test of the PR
-
Slash Command Routing (
.github/workflows/slash.yaml)- Listens for issue comments
- Dispatches commands to appropriate workflows
- Requires write permission (maintainers only)
-
Command Handlers
.github/workflows/chatops_retest.yaml- Handles/retest.github/workflows/chatops_build.yaml- Handles/build
-
Permissions
- Only users with write access can trigger slash commands
- Commands only work on pull requests
On a pull request, comment:
/retest
The bot will:
- Find failed workflow runs for the PR
- Rerun the failed jobs
- React with 👍 on success
- Add a comment with logs if it fails
- Slash command implementation inspired by tektoncd/pipeline
- Uses peter-evans/slash-command-dispatch