From d3cfe387707aa6bf092333902db8c0e50aded212 Mon Sep 17 00:00:00 2001 From: Christian Petersen Date: Wed, 11 Mar 2026 12:38:48 -0600 Subject: [PATCH 1/4] Use internal fork of Apptio-PNE maintained actions --- .github/workflows/pr.yaml | 13 ++++++++++--- README.md | 32 ++++++++++++++++++++++---------- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 361f271..c378281 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -22,12 +22,19 @@ jobs: run: | echo "${{ steps.prediction.outputs.PREDICTION_TABLE }}" - - name: Update PR with prediction results - uses: edumserrano/find-create-or-update-comment@v1 + - name: Find existing PR comment + uses: kubecost/github-actions/find-comment@main + id: find-comment with: issue-number: ${{ github.event.pull_request.number }} - body-includes: '' comment-author: 'github-actions[bot]' + body-includes: '' + + - name: Create or update PR comment with prediction results + uses: kubecost/github-actions/create-or-update-comment@main + with: + issue-number: ${{ github.event.pull_request.number }} + comment-id: ${{ steps.find-comment.outputs.comment-id }} edit-mode: replace body: | diff --git a/README.md b/README.md index a6cbc89..3356713 100644 --- a/README.md +++ b/README.md @@ -39,17 +39,23 @@ below. # is a directory and process all .yaml/.yml files it finds. path: ./repo -# Write/update a comment with the prediction results. -- name: Update PR with prediction results - uses: edumserrano/find-create-or-update-comment@v1 +# Find existing PR comment, then create or update it with prediction results. +- name: Find existing PR comment + uses: kubecost/github-actions/find-comment@main + id: find-comment with: issue-number: ${{ github.event.pull_request.number }} - body-includes: '' comment-author: 'github-actions[bot]' + body-includes: '' +- name: Create or update PR comment with prediction results + uses: kubecost/github-actions/create-or-update-comment@main + with: + issue-number: ${{ github.event.pull_request.number }} + comment-id: ${{ steps.find-comment.outputs.comment-id }} edit-mode: replace body: | - + ## Kubecost's total cost prediction for K8s YAML Manifests in this PR \``` @@ -135,17 +141,23 @@ jobs: # # kubecost_api_path: "http://localhost:9090/model" - # Write/update a comment with the prediction results. - - name: Update PR with prediction results - uses: edumserrano/find-create-or-update-comment@v1 + # Find existing PR comment, then create or update it with prediction results. + - name: Find existing PR comment + uses: kubecost/github-actions/find-comment@main + id: find-comment with: issue-number: ${{ github.event.pull_request.number }} - body-includes: '' comment-author: 'github-actions[bot]' + body-includes: '' + - name: Create or update PR comment with prediction results + uses: kubecost/github-actions/create-or-update-comment@main + with: + issue-number: ${{ github.event.pull_request.number }} + comment-id: ${{ steps.find-comment.outputs.comment-id }} edit-mode: replace body: | - + ## Kubecost's total cost prediction for K8s YAML Manifests in this PR \``` From 1da0f1190a32716553dcf9d7730a3f2b4ee16524 Mon Sep 17 00:00:00 2001 From: Christian Petersen Date: Wed, 11 Mar 2026 13:28:24 -0600 Subject: [PATCH 2/4] Add auth token --- .github/workflows/pr.yaml | 2 ++ README.md | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index c378281..3f08c35 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -26,6 +26,7 @@ jobs: uses: kubecost/github-actions/find-comment@main id: find-comment with: + token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.pull_request.number }} comment-author: 'github-actions[bot]' body-includes: '' @@ -33,6 +34,7 @@ jobs: - name: Create or update PR comment with prediction results uses: kubecost/github-actions/create-or-update-comment@main with: + token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.pull_request.number }} comment-id: ${{ steps.find-comment.outputs.comment-id }} edit-mode: replace diff --git a/README.md b/README.md index 3356713..320cd41 100644 --- a/README.md +++ b/README.md @@ -44,12 +44,14 @@ below. uses: kubecost/github-actions/find-comment@main id: find-comment with: + token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.pull_request.number }} comment-author: 'github-actions[bot]' body-includes: '' - name: Create or update PR comment with prediction results uses: kubecost/github-actions/create-or-update-comment@main with: + token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.pull_request.number }} comment-id: ${{ steps.find-comment.outputs.comment-id }} edit-mode: replace @@ -146,12 +148,14 @@ jobs: uses: kubecost/github-actions/find-comment@main id: find-comment with: + token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.pull_request.number }} comment-author: 'github-actions[bot]' body-includes: '' - name: Create or update PR comment with prediction results uses: kubecost/github-actions/create-or-update-comment@main with: + token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.pull_request.number }} comment-id: ${{ steps.find-comment.outputs.comment-id }} edit-mode: replace From 338ff1f45a78ab9850bf0f1b53e0a60974fc6356 Mon Sep 17 00:00:00 2001 From: Christian Petersen Date: Wed, 11 Mar 2026 14:50:50 -0600 Subject: [PATCH 3/4] Tweaks --- .github/workflows/pr.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 3f08c35..1452f1a 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -11,6 +11,13 @@ jobs: with: path: ./ + - name: Checkout kubecost/github-actions + uses: actions/checkout@v2 + with: + repository: kubecost/github-actions + token: ${{ secrets.ACTIONS_PAT }} + path: ./github-actions + - name: Run predict on test files id: prediction uses: ./ @@ -23,7 +30,7 @@ jobs: echo "${{ steps.prediction.outputs.PREDICTION_TABLE }}" - name: Find existing PR comment - uses: kubecost/github-actions/find-comment@main + uses: ./github-actions/find-comment id: find-comment with: token: ${{ secrets.GITHUB_TOKEN }} @@ -32,7 +39,7 @@ jobs: body-includes: '' - name: Create or update PR comment with prediction results - uses: kubecost/github-actions/create-or-update-comment@main + uses: ./github-actions/create-or-update-comment with: token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.pull_request.number }} From 8e5d5e38e5a5740dd08e756ff5198ffd79f160cb Mon Sep 17 00:00:00 2001 From: Christian Petersen Date: Wed, 11 Mar 2026 14:55:56 -0600 Subject: [PATCH 4/4] Update token --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 1452f1a..3d42e46 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v2 with: repository: kubecost/github-actions - token: ${{ secrets.ACTIONS_PAT }} + token: ${{ secrets.CPA_ACTIONS_PAT }} path: ./github-actions - name: Run predict on test files