Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
12dfe1b
Use dynamic github token
tamalsaha May 11, 2026
24cb9e2
Harden GitHub Actions workflows
tamalsaha May 11, 2026
134672c
Add job permissions for workflow
tamalsaha May 13, 2026
a47be42
Add job permissions for workflow
tamalsaha May 13, 2026
dda1a69
Use GitHub App token in publish-oci.yml
tamalsaha May 13, 2026
098abe3
Use GitHub App token for release tracker comments
tamalsaha May 13, 2026
06edbbb
Apply kubedb/installer#2281: harden CI workflows
tamalsaha May 13, 2026
5456483
Remove Prepare git step from release-tracker.yml
tamalsaha May 13, 2026
ba9f930
cve-report.yml: use LGTM App token
tamalsaha May 13, 2026
e657202
publish-oci.yml: drop redundant permissions and GITHUB_USER
tamalsaha May 13, 2026
9713bf7
Rename LGTM App token step id to lgtm-app-token
tamalsaha May 13, 2026
7e96d0b
release-tracker.yml: gate at job level with merged == true
tamalsaha May 13, 2026
207c35f
release-tracker.yml: drop permissions block
tamalsaha May 13, 2026
8d545a1
release-tracker.yml: grant permission-pull-requests to LGTM App
tamalsaha May 13, 2026
8c79580
Normalize Prepare git user, fetch-depth, drop permission-issues
tamalsaha May 14, 2026
aa0983c
Add 1gtm-app[bot] to kodiak auto_approve_usernames
tamalsaha May 14, 2026
62d4192
Normalize kodiak auto_approve_usernames
tamalsaha May 14, 2026
d77300b
Pin docker/login-action to v4.1.0
tamalsaha May 14, 2026
9573f45
Bump softprops/action-gh-release to v2.6.2; add permissions
tamalsaha May 14, 2026
3453d2c
Makefile: use --tags in git describe so lightweight tags resolve
tamalsaha May 14, 2026
747c780
Remove bzr install from workflows
tamalsaha May 14, 2026
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
2 changes: 1 addition & 1 deletion .github/.kodiak.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ strip_html_comments = true # default: false
always = true # default: false

[approve]
auto_approve_usernames = ["1gtm", "tamalsaha"]
auto_approve_usernames = ["tamalsaha", "1gtm", "1gtm-app[bot]"]
12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,16 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Set up Go 1.25
uses: actions/setup-go@v5
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version: '1.25'
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v4
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- name: Prepare Host
run: |
sudo apt-get -qq update || true
sudo apt-get install -y bzr
# install yq
curl -fsSL -o yqq https://github.com/mikefarah/yq/releases/download/3.3.0/yq_linux_amd64
chmod +x yqq
Expand Down Expand Up @@ -63,7 +61,7 @@ jobs:
matrix:
k8s: [v1.28.15, v1.30.13, v1.32.5, v1.34.0]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- name: Install yq
run: |
Expand All @@ -73,10 +71,10 @@ jobs:

- name: Create Kubernetes ${{ matrix.k8s }} cluster
id: kind
uses: engineerd/setup-kind@v0.5.0
uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0
with:
version: v0.29.0
image: kindest/node:${{ matrix.k8s }}
node_image: kindest/node:${{ matrix.k8s }}

- name: Prepare cluster for testing
id: local-path
Expand Down
52 changes: 24 additions & 28 deletions .github/workflows/cve-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,30 @@ jobs:
report:
name: Report
runs-on: ubuntu-24.04
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- name: Set up Go
uses: actions/setup-go@v5
- name: Generate LGTM App token
id: lgtm-app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
go-version: '1.25'

- name: Prepare git
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
run: |
set -x
git config --global user.name "1gtm"
git config --global user.email "1gtm@appscode.com"
git config --global \
url."https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com".insteadOf \
"https://github.com"
# git remote set-url origin https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
client-id: ${{ secrets.LGTM_APP_CLIENT_ID }}
private-key: ${{ secrets.LGTM_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: installer
permission-contents: write
permission-pull-requests: write

- name: Install trivy
env:
TRIVY_VERSION: 0.70.0
run: |
# wget https://github.com/aquasecurity/trivy/releases/download/v0.18.3/trivy_0.18.3_Linux-64bit.deb
# sudo dpkg -i trivy_0.18.3_Linux-64bit.deb
sudo apt-get install -y --no-install-recommends wget apt-transport-https gnupg lsb-release
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/trivy.list
sudo apt-get update
sudo apt-get install -y --no-install-recommends trivy
curl -fsSL -o trivy.deb "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.deb"
sudo dpkg -i trivy.deb
rm trivy.deb

- name: Install image packer
run: |
Expand All @@ -57,13 +51,15 @@ jobs:
image-packer generate-cve-report \
--output-dir=catalog \
--src=catalog/imagelist.yaml
git add catalog/README.md || true
git commit -s -a -m "Update cve report $(date --rfc-3339=date)"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7.0.11
with:
token: ${{ secrets.LGTM_GITHUB_TOKEN }}
token: ${{ steps.lgtm-app-token.outputs.token }}
commit-message: Update cve report
author: ${{ github.actor }} <${{ github.actor }}@appscode.com>
committer: ${{ github.actor }} <${{ github.actor }}@appscode.com>
signoff: true
title: Update cve report
branch: update-cve-report
delete-branch: true
Expand Down
31 changes: 20 additions & 11 deletions .github/workflows/publish-oci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,33 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
fetch-depth: 0

- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
with:
cache-image: false

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0

- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ secrets.GHCRX_APP_CLIENT_ID }}
private-key: ${{ secrets.GHCRX_APP_PRIVATE_KEY }}
owner: appscode-charts

- name: Log in to the GitHub Container registry
uses: docker/login-action@v2
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
registry: ghcr.io
username: 1gtm
password: ${{ secrets.LGTM_GITHUB_TOKEN }}
username: ${{ github.actor }}
password: ${{ steps.app-token.outputs.token }}

- name: Install Helm 3
run: |
Expand All @@ -41,8 +51,8 @@ jobs:
- name: Clone charts repository
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
CHART_REPOSITORY: github.com/appscode/charts
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
CHART_REPOSITORY: ${{ secrets.CHART_REPOSITORY }}
run: |
url="https://${GITHUB_USER}:${GITHUB_TOKEN}@${CHART_REPOSITORY}.git"
cd $RUNNER_WORKSPACE
Expand All @@ -53,9 +63,8 @@ jobs:

- name: Publish OCI charts
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
CHART_REPOSITORY: github.com/appscode/charts
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
CHART_REPOSITORY: ${{ secrets.CHART_REPOSITORY }}
run: |
export REGISTRY_0=oci://ghcr.io/appscode-charts
./hack/scripts/update-chart-dependencies.sh
Expand Down
32 changes: 13 additions & 19 deletions .github/workflows/release-tracker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,25 @@ concurrency:

jobs:
build:
if: github.event.pull_request.merged == true
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- name: Prepare git
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
run: |
git config --global user.name "${GITHUB_USER}"
git config --global user.email "${GITHUB_USER}@appscode.com"
git remote set-url origin https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git

- name: Install GitHub CLI
run: |
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
sudo mv bin/hub /usr/local/bin
- name: Generate LGTM App token
id: lgtm-app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ secrets.LGTM_APP_CLIENT_ID }}
private-key: ${{ secrets.LGTM_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: CHANGELOG
permission-pull-requests: write

- name: Update release tracker
if: |
github.event.action == 'closed' &&
github.event.pull_request.merged == true
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ steps.lgtm-app-token.outputs.token }}
run: |
./hack/scripts/update-release-tracker.sh
12 changes: 5 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ jobs:
build:
name: Build
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Install GitHub CLI
run: |
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
sudo mv bin/hub /usr/local/bin
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
fetch-depth: 0

- name: Install Helm 3
run: |
Expand All @@ -42,7 +41,6 @@ jobs:

- name: Package
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
CHART_REPOSITORY: ${{ secrets.CHART_REPOSITORY }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ API_GROUPS ?= installer:v1alpha1

# This version-strategy uses git tags to set the version string
git_branch := $(shell git rev-parse --abbrev-ref HEAD)
git_tag := $(shell git describe --exact-match --abbrev=0 2>/dev/null || echo "")
git_tag := $(shell git describe --tags --exact-match --abbrev=0 2>/dev/null || echo "")
commit_hash := $(shell git rev-parse --verify HEAD)
commit_timestamp := $(shell date --date="@$$(git show -s --format=%ct)" --utc +%FT%T)

Expand Down
8 changes: 4 additions & 4 deletions hack/scripts/open-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pr_branch=${GITHUB_REPOSITORY}@${GITHUB_SHA:0:8}
git checkout -b $pr_branch
git commit -a -s -m "Update crds for $pr_branch"
git push -u origin HEAD
hub pull-request \
--labels automerge \
--message "Update crds for $pr_branch" \
--message "$(git show -s --format=%b)"
gh pr create \
--label automerge \
--title "Update crds for $pr_branch" \
--body "$(git show -s --format=%b)"
2 changes: 1 addition & 1 deletion hack/scripts/update-release-tracker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ case $GITHUB_BASE_REF in
;;
esac

hub api "$api_url" -f body="$msg"
gh api "$api_url" -f body="$msg"
Loading