From a2b13f7207cd6fd405d8729e351fc73fd878a4b9 Mon Sep 17 00:00:00 2001 From: Ayush More Date: Fri, 5 Jun 2026 22:30:25 +0530 Subject: [PATCH 1/4] Refine thank-you workflow conditions and checkout Updated the condition for the thank-you job to check for true explicitly and added a reference to the base SHA when checking out the repository. Signed-off-by: Ayush More --- .github/workflows/thank-you.yaml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/thank-you.yaml b/.github/workflows/thank-you.yaml index 782c4a68f4..314b9ea6fe 100644 --- a/.github/workflows/thank-you.yaml +++ b/.github/workflows/thank-you.yaml @@ -11,13 +11,13 @@ permissions: jobs: thank-you: - # Only run if the PR was actually merged - if: github.event.pull_request.merged + if: github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - # We must check out the code to read the MAINTAINERS.json file - name: Checkout repository uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.base.sha }} - name: Leave a Thank You Comment uses: actions/github-script@v7 @@ -26,29 +26,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 }); - \ No newline at end of file From edec6106149bd87f9a4d4035580b05bdd55f9f6f Mon Sep 17 00:00:00 2001 From: Ayush More Date: Fri, 5 Jun 2026 22:31:54 +0530 Subject: [PATCH 2/4] Update README to reflect documentation change Signed-off-by: Ayush More --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 7624567e64..cc951bcb29 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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. From 0946a12638d21b48f8f315dc02fb07ed45f000da Mon Sep 17 00:00:00 2001 From: Ayush More Date: Sat, 6 Jun 2026 20:31:12 +0530 Subject: [PATCH 3/4] Update stale.yaml Signed-off-by: Ayush More --- .github/workflows/stale.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index 321a598289..b79d88ffec 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -21,5 +21,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' \ No newline at end of file + exempt-pr-labels: 'not-auto-close' From 44f78176dc5ede4956799ddfad1f799d3343b439 Mon Sep 17 00:00:00 2001 From: Ayush More Date: Sun, 21 Jun 2026 12:27:36 +0530 Subject: [PATCH 4/4] ci: remove code-butler workflow ca-dp/code-butler@v1 is an unpinned third-party action that receives OPENAI_API_KEY. The v1 mutable tag means any push to that repo executes arbitrary code in our CI with access to that secret. The action also uses gpt-4-1106-preview, which OpenAI deprecated in early 2024, making it likely already broken. If AI-assisted review is needed in future, implement it with an in-repo actions/github-script step that calls the API directly. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/code-butler.yaml | 32 ------------------- ...security-code-butler-unpinned-abandoned.md | 21 ++++++++++++ 2 files changed, 21 insertions(+), 32 deletions(-) delete mode 100644 .github/workflows/code-butler.yaml create mode 100644 workflow-audit/issues/security-code-butler-unpinned-abandoned.md diff --git a/.github/workflows/code-butler.yaml b/.github/workflows/code-butler.yaml deleted file mode 100644 index 8e95270eb1..0000000000 --- a/.github/workflows/code-butler.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: code_butler - -permissions: - contents: read - pull-requests: write - -on: - issue_comment: - types: [created] - -jobs: - review: - if: startsWith(github.event.comment.body, '/review') - runs-on: ubuntu-24.04 - steps: - - uses: ca-dp/code-butler@v1 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - cmd: review - model: gpt-4-1106-preview - chat: - if: startsWith(github.event.comment.body, '/chat') - runs-on: ubuntu-24.04 - steps: - - uses: ca-dp/code-butler@v1 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - cmd: chat - model: gpt-4-1106-preview - comment_body: ${{ github.event.comment.body }} diff --git a/workflow-audit/issues/security-code-butler-unpinned-abandoned.md b/workflow-audit/issues/security-code-butler-unpinned-abandoned.md new file mode 100644 index 0000000000..b5d722e4bf --- /dev/null +++ b/workflow-audit/issues/security-code-butler-unpinned-abandoned.md @@ -0,0 +1,21 @@ +# Security: code-butler.yaml uses unpinned third-party action with API key access + +**File:** `.github/workflows/code-butler.yaml` + +## Problem + +`ca-dp/code-butler@v1` is: +- **Not SHA-pinned**: the `v1` mutable tag means any push to the upstream repo moves what this action executes. Anyone who compromises that repo gets code execution in PipeCD CI with access to `OPENAI_API_KEY`. +- **Uses a deprecated model**: `gpt-4-1106-preview` was deprecated by OpenAI in early 2024. The action may already be broken. +- **Third-party, low-visibility**: `ca-dp` is not a well-known GitHub Actions publisher. The action has minimal community scrutiny. + +## Impact + +- `OPENAI_API_KEY` secret is passed to an unpinned, third-party action. +- `/review` and `/chat` commands on PRs may already be non-functional. + +## Recommended Fix + +Option A (preferred): Remove the workflow and revoke/rotate `OPENAI_API_KEY`. Check git history for last successful use — if it has not worked since the model was deprecated, it is already dead. + +Option B: If AI review is actively used, replace with a custom `actions/github-script` step that calls the API directly (code lives in-repo, no third-party action trust required), and use a current model.