Profile
Back to NewsBack
GitHub Trending 3 min
Reader Mode
cncf/prow-github-actions: Slash commands, jobs, and chat-ops for Github actions inspired by Kubernetes Prow ⚓️

cncf/prow-github-actions: Slash commands, jobs, and chat-ops for Github actions inspired by Kubernetes Prow ⚓️

14 hours ago

Prow Github Actions ⛵️

This project is inspired by Prow and brings its chat-ops functionality and project management to a simple, Github actions workflow.

Prow is a Kubernetes based CI/CD system ... and provides GitHub automation in the form of policy enforcement, chat-ops via /foo style commands, and automatic PR merging.

Quickstart

Setting up an organization? Start with Prow for your organization.

Check out the _"EXAMPLE"_ issues and pull requests (open and closed) in this repo to see how this works!

One caller workflow installs the whole bot. Copy templates/workflow-templates/prow.yml to .github/workflows/prow.yml, or install Prow from Actions → New workflow once your organization ships it as a workflow template. Policy forbids pull_request_target? Use prow-pull-request.yml instead (without pull_request_target):

name: Prow
on:
  issues:
    types: [opened, reopened, labeled, unlabeled]
  issue_comment:
    types: [created]
  pull_request_target:
    types: [opened, reopened, synchronize, ready_for_review, labeled, unlabeled]
  pull_request_review:
    types: [submitted, dismissed]
  check_suite:
    types: [completed]
  schedule:
    - cron: '0    '
  workflow_dispatch:
  push:
    branches: [main]
    paths: [.github/prow.yaml]

permissions: contents: write issues: write pull-requests: write statuses: write actions: write

concurrency: group: prow-${{ github.event_name }}-${{ github.event.action }}-${{ github.event.comment.id || github.event.pull_request.number || github.event.issue.number || github.run_id }} cancel-in-progress: false

jobs: prow: if: github.event_name != 'workflow_dispatch' && github.event_name != 'push' uses: cncf/prow-github-actions/.github/workflows/[email protected]

label-sync: if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' uses: cncf/prow-github-actions/.github/workflows/[email protected] with: jobs: label-sync

With no configuration at all this gives you every built-in /command (/retest and /test re-run the pull request's GitHub Actions runs, /ok-to-test approves a first-time contributor's held runs), reviewers from OWNERS files, fork-safe automatic merging on lgtm (plus approved when the repository has OWNERS files) where lgtm is bound to the reviewed commit and never merges commits pushed after it (on a branch that requires a merge queue it enqueues and GitHub merges), and the label-sync job (run it once from Actions → Prow → Run workflow so the labels exist). Add a prow.yaml to the repository or to your organization's .github repository for label families and needs-* rules (starter, configuration). The Installing guide covers organizations, upgrading, inputs and secrets.

These docs describe main; the latest release is v3.0.1 (releasing). The action requires the node24 runtime (GitHub requires actions/runner 2.327.1 or newer for node24 on self-hosted runners).

Using the action directly

The action can also be a step of your own workflow, which is the form for GitHub Enterprise Server (the reusable workflow needs github.com) and for mixing it with other steps:

name: Prow github actions
on:
  issue_comment:
    types: [created]

permissions: issues: write pull-requests: write statuses: write actions: write contents: read

jobs: execute: runs-on: ubuntu-latest steps: - uses: cncf/[email protected] with: prow-commands: /assign /unassign /cc /uncc /approve /lgtm /hold /close /reopen /lock /retitle /milestone /remove /area /kind /priority /label /lifecycle /stage /status /help /good-first-issue /retest /test /ok-to-test /meow github-token: '${{ secrets.GITHUB_TOKEN }}'

This is the full list of available commands. Prow-style aliases (/unhold, /remove-kind, ...) come with their base command, and listing an alias enables the whole command family. Events has the direct form subscribed to everything; jobs, automatic merging and PR jobs have the per-feature workflows.

Documentation


_open water breeze_\ _the ocean seas are endless_\ _forward to the prow_

Chat with me