Skip to content

Commit e0f42d8

Browse files
authored
Harden CI workflows
Signed-off-by: Tamal Saha <tamal@appscode.com>
1 parent 2c9987c commit e0f42d8

4 files changed

Lines changed: 15 additions & 22 deletions

File tree

.github/.kodiak.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ strip_html_comments = true # default: false
1515
always = true # default: false
1616

1717
[approve]
18-
auto_approve_usernames = ["1gtm", "tamalsaha"]
18+
auto_approve_usernames = ["tamalsaha", "1gtm", "1gtm-app[bot]"]

.github/workflows/ci.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,15 @@ jobs:
1919
runs-on: ubuntu-24.04
2020
steps:
2121
- name: Set up Go 1.25
22-
uses: actions/setup-go@v5
22+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
2323
with:
2424
go-version: '1.25'
2525
id: go
2626

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

2929
- name: Prepare Host
3030
run: |
31-
sudo apt-get -qq update || true
32-
sudo apt-get install -y bzr
3331
curl -LO https://dl.k8s.io/release/v1.32.1/bin/linux/amd64/kubectl
3432
chmod +x ./kubectl
3533
sudo mv ./kubectl /usr/local/bin/kubectl
@@ -46,14 +44,14 @@ jobs:
4644
matrix:
4745
k8s: [v1.29.14, v1.31.14, v1.33.7, v1.35.0]
4846
steps:
49-
- uses: actions/checkout@v4
47+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
5048

5149
- name: Create Kubernetes ${{ matrix.k8s }} cluster
5250
id: kind
53-
uses: engineerd/setup-kind@v0.5.0
51+
uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0
5452
with:
5553
version: v0.31.0
56-
image: kindest/node:${{ matrix.k8s }}
54+
node_image: kindest/node:${{ matrix.k8s }}
5755

5856
- name: Test crds
5957
run: |
Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,12 @@ jobs:
1111
runs-on: ubuntu-24.04
1212
steps:
1313
- name: Set up Go 1.25
14-
uses: actions/setup-go@v5
14+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
1515
with:
1616
go-version: '1.25'
1717
id: go
1818

19-
- uses: actions/checkout@v4
20-
21-
- name: Install GitHub CLI
22-
run: |
23-
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
24-
sudo mv bin/hub /usr/local/bin
19+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
2520

2621
- name: Install crd-importer
2722
run: |
@@ -31,21 +26,21 @@ jobs:
3126
3227
- name: Clone installer repository
3328
env:
34-
GITHUB_USER: 1gtm
35-
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
29+
GITHUB_USER: ${{ github.actor }}
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3631
INSTALLER_REPOSITORY: ${{ secrets.INSTALLER_REPOSITORY }}
3732
run: |
3833
url="https://${GITHUB_USER}:${GITHUB_TOKEN}@${INSTALLER_REPOSITORY}.git"
3934
cd $RUNNER_WORKSPACE
4035
git clone $url
4136
cd $(basename $INSTALLER_REPOSITORY)
42-
git config user.name "${GITHUB_USER}"
43-
git config user.email "${GITHUB_USER}@appscode.com"
37+
git config user.name "1gtm"
38+
git config user.email "1gtm@appscode.com"
4439
4540
- name: Update crds
4641
env:
47-
GITHUB_USER: 1gtm
48-
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
42+
GITHUB_USER: ${{ github.actor }}
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4944
INSTALLER_REPOSITORY: ${{ secrets.INSTALLER_REPOSITORY }}
5045
run: |
5146
export INSTALLER_ROOT=$RUNNER_WORKSPACE/$(basename $INSTALLER_REPOSITORY)

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ API_GROUPS ?= appcatalog:v1alpha1 metrics:v1alpha1
2626

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

0 commit comments

Comments
 (0)