Skip to content

Commit ac6b67e

Browse files
Revert "Harden CI workflows (#1730)" (#1731)
1 parent 17883ca commit ac6b67e

8 files changed

Lines changed: 56 additions & 50 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 = ["tamalsaha", "1gtm", "1gtm-app[bot]"]
18+
auto_approve_usernames = ["1gtm", "tamalsaha"]

.github/workflows/cherry-pick.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,25 @@ jobs:
1010
runs-on: ubuntu-24.04
1111

1212
steps:
13-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
13+
- uses: actions/checkout@v1
1414

1515
- name: Prepare git
1616
env:
17-
GITHUB_USER: ${{ github.actor }}
18-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
GITHUB_USER: 1gtm
18+
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
1919
run: |
2020
git config --global user.name "${GITHUB_USER}"
2121
git config --global user.email "${GITHUB_USER}@appscode.com"
2222
git remote set-url origin https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
2323
24+
- name: Install GitHub CLI
25+
run: |
26+
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
27+
sudo mv bin/hub /usr/local/bin
28+
2429
- name: Update release branches
2530
env:
26-
GITHUB_USER: ${{ github.actor }}
27-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
GITHUB_USER: 1gtm
32+
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
2833
run: |
2934
./hack/scripts/cherry-pick.sh

.github/workflows/ci.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,36 @@ jobs:
1414
runs-on: ubuntu-24.04
1515
steps:
1616
- name: Set up Go 1.25
17-
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
17+
uses: actions/setup-go@v5
1818
with:
1919
go-version: '1.25'
2020
id: go
2121

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

2424
- name: Set up QEMU
2525
id: qemu
26-
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
26+
uses: docker/setup-qemu-action@v3
2727
with:
2828
cache-image: false
2929

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

3333
- name: Prepare Host
3434
run: |
35+
sudo apt-get -qq update || true
36+
sudo apt-get install -y bzr
3537
3638
- name: Run checks
3739
run: |
3840
make ci
3941
40-
- name: Login to GitHub Container Registry
41-
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
42-
with:
43-
registry: ghcr.io
44-
username: 1gtm
45-
password: ${{ secrets.LGTM_GITHUB_TOKEN }}
46-
4742
- name: Build
4843
env:
4944
REGISTRY: ghcr.io/appscodeci
45+
DOCKER_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
46+
USERNAME: 1gtm
5047
run: |
48+
docker login ghcr.io --username ${USERNAME} --password ${DOCKER_TOKEN}
5149
make push

.github/workflows/release-tracker.yml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,31 @@ on:
66

77
jobs:
88
build:
9-
if: github.event.pull_request.merged == true
109
runs-on: ubuntu-24.04
1110

1211
steps:
13-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
12+
- uses: actions/checkout@v4
1413

15-
- name: Generate LGTM App token
16-
id: lgtm-app-token
17-
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
18-
with:
19-
client-id: ${{ secrets.LGTM_APP_CLIENT_ID }}
20-
private-key: ${{ secrets.LGTM_APP_PRIVATE_KEY }}
21-
owner: ${{ github.repository_owner }}
22-
repositories: CHANGELOG
23-
permission-pull-requests: write
14+
- name: Prepare git
15+
env:
16+
GITHUB_USER: 1gtm
17+
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
18+
run: |
19+
git config --global user.name "${GITHUB_USER}"
20+
git config --global user.email "${GITHUB_USER}@appscode.com"
21+
git remote set-url origin https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
22+
23+
- name: Install GitHub CLI
24+
run: |
25+
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
26+
sudo mv bin/hub /usr/local/bin
2427
2528
- name: Update release tracker
29+
if: |
30+
github.event.action == 'closed' &&
31+
github.event.pull_request.merged == true
2632
env:
27-
GITHUB_USER: ${{ github.actor }}
28-
GITHUB_TOKEN: ${{ steps.lgtm-app-token.outputs.token }}
33+
GITHUB_USER: 1gtm
34+
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
2935
run: |
3036
./hack/scripts/update-release-tracker.sh

.github/workflows/release.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ jobs:
99
build:
1010
name: Build
1111
runs-on: ubuntu-24.04
12-
permissions:
13-
contents: write
1412
steps:
1513
- name: Check out code into the Go module directory
16-
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
17-
with:
18-
fetch-depth: 0
14+
uses: actions/checkout@v1
15+
16+
- name: Install GitHub CLI
17+
run: |
18+
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
19+
sudo mv bin/hub /usr/local/bin
1920
2021
- name: Print version info
2122
id: semver
@@ -24,23 +25,19 @@ jobs:
2425
2526
- name: Set up QEMU
2627
id: qemu
27-
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
28+
uses: docker/setup-qemu-action@v3
2829
with:
2930
cache-image: false
3031

3132
- name: Set up Docker Buildx
32-
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
33-
34-
- name: Log in to the GitHub Container registry
35-
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
36-
with:
37-
registry: ghcr.io
38-
username: 1gtm
39-
password: ${{ secrets.LGTM_GITHUB_TOKEN }}
33+
uses: docker/setup-buildx-action@v3
4034

4135
- name: Publish to GitHub Container Registry
4236
env:
4337
REGISTRY: ghcr.io/stashed
38+
DOCKER_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
39+
USERNAME: 1gtm
4440
APPSCODE_ENV: prod
4541
run: |
42+
docker login ghcr.io --username ${USERNAME} --password ${DOCKER_TOKEN}
4643
make release

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ REGISTRY ?= stashed
2525

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

hack/scripts/cherry-pick.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ while IFS=/ read -r -u9 repo branch; do
3737
git checkout -b $pr_branch
3838
git cherry-pick --strategy=recursive -X theirs $GITHUB_SHA
3939
git push -u origin HEAD -f
40-
gh pr create \
40+
hub pull-request \
4141
--base $branch \
42-
--label automerge \
43-
--title "[cherry-pick] $(git show -s --format=%s)" \
44-
--body "$(git show -s --format=%b | sed --expression='/\/cherry-pick/d')" || true
42+
--labels automerge \
43+
--message "[cherry-pick] $(git show -s --format=%s)" \
44+
--message "$(git show -s --format=%b | sed --expression='/\/cherry-pick/d')" || true
4545
sleep 15
4646
done 9< <(git branch -r | grep release)

hack/scripts/update-release-tracker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ case $GITHUB_BASE_REF in
6969
;;
7070
esac
7171

72-
gh api "$api_url" -f body="$msg"
72+
hub api "$api_url" -f body="$msg"

0 commit comments

Comments
 (0)