Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
54260f6
Use dynamic github token
tamalsaha May 11, 2026
b17ead4
Harden GitHub Actions workflows
tamalsaha May 11, 2026
3d96d45
Add job permissions for workflow
tamalsaha May 13, 2026
3bc6b4e
Use GitHub App token for release tracker comments
tamalsaha May 13, 2026
2358181
Apply kubedb/installer#2281: harden CI workflows
tamalsaha May 13, 2026
13a6950
Remove Prepare git step from release-tracker.yml
tamalsaha May 13, 2026
82b39e4
Rename LGTM App token step id to lgtm-app-token
tamalsaha May 13, 2026
7a5fc55
release-tracker.yml: gate at job level with merged == true
tamalsaha May 13, 2026
2cb4325
release-tracker.yml: drop permissions block
tamalsaha May 13, 2026
2fb0044
release-tracker.yml: grant permission-pull-requests to LGTM App
tamalsaha May 13, 2026
6af83ce
update-docs.yml: use LGTM App token
tamalsaha May 13, 2026
b85a29e
release.yml: use LGTM App token for krew-index publish
tamalsaha May 13, 2026
a24848f
Normalize Prepare git user, fetch-depth, drop permission-issues
tamalsaha May 14, 2026
6554159
Add 1gtm-app[bot] to kodiak auto_approve_usernames
tamalsaha May 14, 2026
bd64e71
Normalize kodiak auto_approve_usernames
tamalsaha May 14, 2026
b3acaed
Bump softprops/action-gh-release to v2.6.2; add permissions
tamalsaha May 14, 2026
ad23eba
Makefile: use --tags in git describe so lightweight tags resolve
tamalsaha May 14, 2026
7efeb31
Remove bzr install from workflows
tamalsaha May 14, 2026
c15dca1
Pin git user to 1gtm in update-crds/update-docs 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 = ["1gtm", "tamalsaha", "1gtm-app[bot]"]
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ 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: Run checks
run: |
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
51 changes: 38 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +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
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
fetch-depth: 0

- name: Print version info
id: semver
Expand All @@ -25,12 +29,12 @@ jobs:

- 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: Build
env:
Expand All @@ -39,7 +43,7 @@ jobs:
make release COMPRESS=yes

- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@26994186c0ac3ef5cae75ac16aa32e8153525f77 # v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
Expand All @@ -53,18 +57,39 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install GitHub CLI
- name: Classify release
id: release-type
run: |
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
sudo mv bin/hub /usr/local/bin
ref="${GITHUB_REF}"
if [[ "$ref" == refs/tags/* ]] \
&& [[ "$ref" != *-alpha.* ]] \
&& [[ "$ref" != *-beta.* ]] \
&& [[ "$ref" != *-rc.* ]]; then
echo "is_release=true" >> "$GITHUB_OUTPUT"
else
echo "is_release=false" >> "$GITHUB_OUTPUT"
fi

- name: Generate LGTM App token
id: lgtm-app-token
if: steps.release-type.outputs.is_release == 'true'
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: appscode
repositories: krew-index
permission-contents: write
permission-pull-requests: write

- name: Clone krew-index repository
if: steps.release-type.outputs.is_release == 'true'
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ steps.lgtm-app-token.outputs.token }}
run: |
KREW_INDEX_REPOSITORY=github.com/appscode/krew-index
url="https://${GITHUB_USER}:${GITHUB_TOKEN}@${KREW_INDEX_REPOSITORY}.git"
url="https://x-access-token:${GITHUB_TOKEN}@${KREW_INDEX_REPOSITORY}.git"
cd $RUNNER_WORKSPACE
git clone $url
cd $(basename $KREW_INDEX_REPOSITORY)
Expand All @@ -73,9 +98,9 @@ jobs:

- name: Publish krew manifest
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
if: startsWith(github.event.ref, 'refs/tags/') && (contains(github.ref, '-alpha.') || contains(github.ref, '-beta.') || contains(github.ref, '-rc.')) == false
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ steps.lgtm-app-token.outputs.token }}
if: steps.release-type.outputs.is_release == 'true'
run: |
cd $RUNNER_WORKSPACE/krew-index
./hack/scripts/open-pr.sh $GITHUB_WORKSPACE stash
37 changes: 27 additions & 10 deletions .github/workflows/update-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,42 @@ 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

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

- name: Install GitHub CLI

- name: Parse docs repository
id: docs-repo
env:
DOCS_REPOSITORY: ${{ secrets.DOCS_REPOSITORY }}
run: |
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
sudo mv bin/hub /usr/local/bin
# DOCS_REPOSITORY is expected to be of the form: <host>/<owner>/<name>
path="${DOCS_REPOSITORY#*/}"
echo "owner=${path%%/*}" >> "$GITHUB_OUTPUT"
echo "name=${path##*/}" >> "$GITHUB_OUTPUT"

- 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: ${{ steps.docs-repo.outputs.owner }}
repositories: ${{ steps.docs-repo.outputs.name }}
permission-contents: write
permission-pull-requests: write

- name: Clone charts repository
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ steps.lgtm-app-token.outputs.token }}
DOCS_REPOSITORY: ${{ secrets.DOCS_REPOSITORY }}
run: |
url="https://${GITHUB_USER}:${GITHUB_TOKEN}@${DOCS_REPOSITORY}.git"
url="https://x-access-token:${GITHUB_TOKEN}@${DOCS_REPOSITORY}.git"
cd $RUNNER_WORKSPACE
git clone $url
cd $(basename $DOCS_REPOSITORY)
Expand All @@ -43,8 +60,8 @@ jobs:

- name: Update docs
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ steps.lgtm-app-token.outputs.token }}
DOCS_REPOSITORY: ${{ secrets.DOCS_REPOSITORY }}
run: |
export DOCS_ROOT=$RUNNER_WORKSPACE/$(basename $DOCS_REPOSITORY)
Expand Down
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