Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ on:
- 'release-v*'
- 'feat/*'

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
GO_VERSION: 1.26.2
NODE_VERSION: 20.19.0
Expand All @@ -20,6 +27,7 @@ env:
jobs:
go:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@v3
Expand All @@ -31,6 +39,7 @@ jobs:

plugin:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@v3
Expand All @@ -41,6 +50,7 @@ jobs:

web:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@v3
Expand All @@ -63,6 +73,7 @@ jobs:

chart:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/cherry_pick.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ on:
description: 'release version (e.g. v0.48.1)'
required: true
type: string

permissions:
contents: write
pull-requests: write

jobs:
tool:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ on:
schedule:
- cron: '00 10 * * 1'

permissions:
contents: read
security-events: write
actions: read

jobs:
analyze:
runs-on: ubuntu-24.04
timeout-minutes: 120

strategy:
fail-fast: false
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/first-time-contributor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ permissions:

jobs:
welcome:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Welcome first-time contributor
uses: actions/github-script@v7
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ on:
pull_request:
branches: [ master ]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
code:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/prerelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ on:
paths:
- 'RELEASE'

permissions:
contents: write

jobs:
gh-release:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish_image_chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:
jobs:
artifacts:
runs-on: oracle-vm-8cpu-32gb-x86-64
timeout-minutes: 60
permissions:
contents: read
packages: write
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ on:
description: 'release version (e.g. v0.48.1)'
required: true
type: string

permissions:
contents: write
pull-requests: write

jobs:
tool:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
name: close_stale_issues_and_PRs

on:
schedule:
- cron: '0 0 * * *'

permissions:
issues: write
pull-requests: write

jobs:
stale:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/stale@v8
with:
Expand All @@ -21,5 +27,4 @@ jobs:
close-pr-message: 'This PR was closed because it has been stalled for 7 days with no activity. Feel free to reopen if still applicable.'
days-before-pr-stale: 30
days-before-pr-close: 7
delete-branch: true
exempt-pr-labels: 'not-auto-close'
exempt-pr-labels: 'not-auto-close'
5 changes: 5 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ on:
- master
- 'release-v*'
- 'feat/*'
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
GO_VERSION: 1.26.2
NODE_VERSION: 20.19.0
Expand Down Expand Up @@ -97,6 +101,7 @@ jobs:

integration:
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@v3
Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/thank-you.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ permissions:

jobs:
thank-you:
# Only run if the PR was actually merged
if: github.event.pull_request.merged
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
# We must check out the code to read the MAINTAINERS.json file
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.base.sha }}

- name: Leave a Thank You Comment
uses: actions/github-script@v7
Expand All @@ -26,29 +27,24 @@ jobs:
const fs = require('fs');
const creator = context.payload.pull_request.user.login;

// Skip bots to avoid comment loops
if (creator.endsWith('[bot]')) {
console.log('Skipping bot account.');
return;
}

// Read maintainers list from JSON file
const maintainersData = JSON.parse(fs.readFileSync('MAINTAINERS.json', 'utf8'));
const maintainers = maintainersData.maintainers.map(m => m.toLowerCase());

// Skip core maintainers to avoid spamming the team
if (maintainers.includes(creator.toLowerCase())) {
console.log(`Skipping maintainer account: ${creator}`);
return;
}

const message = 'Thank you for contributing to PipeCD! The changes in this pull request will be part of the upcoming release!';
const message = `Thank you for contributing to PipeCD, @${creator}! The changes in this pull request will be part of the upcoming release!`;

// Post the comment to the PR
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: message
});

2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Documentation
# Documentation XYZ CHANGE FOR TESTING

The source files for the documentation is placing in [content](https://github.com/pipe-cd/pipecd/tree/master/docs/content) directory.

Expand Down
26 changes: 26 additions & 0 deletions workflow-audit/issues/maintenance-action-pinning-inconsistency.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Maintenance: Inconsistent action pinning across workflows

## Problem

The repo pins security-sensitive Docker actions to SHA (good) but leaves many other actions on mutable tags. Dependabot tracks `github-actions` weekly for version bumps but does not enforce SHA pinning.

## Unpinned Actions (not SHA-pinned)

| Action | Used in |
|---|---|
| `actions/setup-go@v3` | build.yaml, test.yaml, publish_binary.yaml, plugin_release.yaml, publish_pipedv1_exp.yaml |
| `actions/setup-node@v3` | build.yaml, test.yaml, publish_site.yaml |
| `azure/setup-helm@v4` | build.yaml, lint.yaml, publish_image_chart.yaml, publish_site.yaml, publish_pipedv1_exp.yaml |
| `actions/labeler@v4` | labeler.yaml |
| `actions/stale@v8` | stale.yaml |
| `actions/github-script@v7` | first-time-contributor.yaml, thank-you.yaml |
| `codecov/codecov-action@v3` | test.yaml |
| `pipe-cd/actions-gh-release@v2.6.0` | prerelease.yaml |
| `github/codeql-action/*@v3` | codeql-analysis.yaml |
| `peter-evans/create-pull-request@v6` | release.yaml, publish_image_chart.yaml, publish_pipedv1_exp.yaml |
| `actions/checkout@v4` | thank-you.yaml (all others are SHA-pinned) |

## Priority

Highest risk: `ca-dp/code-butler@v1` (see separate security issue), `codecov/codecov-action`, `peter-evans/create-pull-request`.
Lower risk: GitHub-owned actions (`setup-go`, `setup-node`, `labeler`, `stale`) where Dependabot provides version tracking.
19 changes: 19 additions & 0 deletions workflow-audit/issues/maintenance-missing-concurrency-controls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Maintenance: build.yaml and gen.yaml are missing concurrency controls

**Files:** `.github/workflows/build.yaml`, `.github/workflows/gen.yaml`

## Problem

`lint.yaml` and `test.yaml` both use the concurrency pattern:

```yaml
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
```

`build.yaml` and `gen.yaml` do not. On active PRs with multiple pushes, stale build and codegen-validation jobs queue up and waste CI minutes. On push to master the cancel-in-progress is false so those runs complete safely.

## Fix

Add the same `concurrency:` block to `build.yaml` and `gen.yaml`.
22 changes: 22 additions & 0 deletions workflow-audit/issues/maintenance-missing-timeouts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Maintenance: Several workflows and jobs are missing timeout-minutes

**Files:** `build.yaml`, `test.yaml` (integration), `codeql-analysis.yaml`, `gen.yaml`, `publish_image_chart.yaml` (artifacts job), `release.yaml`, `stale.yaml`, `prerelease.yaml`

## Problem

Jobs with no `timeout-minutes` can hang indefinitely. On self-hosted runners (`oracle-vm-8cpu-32gb-x86-64`) this is especially dangerous — a hung Docker build holds the runner and blocks all subsequent jobs.

`build_tool.yaml` uses `timeout-minutes: 15` and `publish_tool.yaml` uses `timeout-minutes: 30` — these are the right reference points.

## Recommended Timeouts

| Job | Suggested timeout |
|---|---|
| `build.yaml` go/plugin/web/chart | 30 minutes |
| `test.yaml` integration | 60 minutes |
| `codeql-analysis.yaml` analyze | 120 minutes |
| `publish_image_chart.yaml` artifacts | 60 minutes |
| `gen.yaml` code | 15 minutes |
| `release.yaml` tool | 15 minutes |
| `stale.yaml` stale | 10 minutes |
| `prerelease.yaml` gh-release | 10 minutes |
20 changes: 20 additions & 0 deletions workflow-audit/issues/security-missing-permissions-declarations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Security: Multiple workflows missing explicit permissions declarations

**Files:** `cherry_pick.yaml`, `codeql-analysis.yaml`, `stale.yaml`, `release.yaml`, `build.yaml`, `test.yaml`

## Problem

Workflows without explicit `permissions:` blocks inherit the repository-level default, which may be `contents: write` in some configurations. This violates the principle of least privilege and makes the security posture dependent on a repo setting rather than workflow intent.

Most critically: `codeql-analysis.yaml` is missing `security-events: write`, which is **required** for CodeQL to upload SARIF results to the Security tab. Without it, the scan runs every Monday but findings may be silently discarded.

## Required Permissions per Workflow

| Workflow | Minimum permissions needed |
|---|---|
| `codeql-analysis.yaml` | `contents: read`, `security-events: write`, `actions: read` |
| `stale.yaml` | `issues: write`, `pull-requests: write` |
| `cherry_pick.yaml` | `contents: write`, `pull-requests: write` |
| `release.yaml` | `contents: write`, `pull-requests: write` |
| `build.yaml` | `contents: read` |
| `test.yaml` | `contents: read` |