From 11b51a469fed3a50d753666a9fc76caf01fc5116 Mon Sep 17 00:00:00 2001 From: Cameron Meissner Date: Thu, 26 Sep 2024 11:04:05 -0700 Subject: [PATCH 01/16] feat: github action for make generate --- .github/workflows/generate.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/generate.yaml diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml new file mode 100644 index 00000000000..7fdc4838747 --- /dev/null +++ b/.github/workflows/generate.yaml @@ -0,0 +1,28 @@ +name: generate +on: pull_request + +jobs: + check-generated: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v3 + with: + go-version: '1.22' + + - name: make generate + run: make generate + + - name: configure git + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + + - name: commit and push generated changes + run: | + if [ -n "$(git status --porcelain)" ]; then + git add . + git commit -m "chore: generate via GitHub action" + git push origin HEAD:${{ github.head_ref }} + fi From 2e8119b3485ade3c694c7fa40957ff02780c4825 Mon Sep 17 00:00:00 2001 From: Cameron Meissner Date: Thu, 26 Sep 2024 11:10:56 -0700 Subject: [PATCH 02/16] chore: test --- .github/workflows/generate.yaml | 6 ++++-- parts/linux/cloud-init/artifacts/components.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index 7fdc4838747..6c3b22acd30 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -1,8 +1,8 @@ -name: generate +name: auto-generate on: pull_request jobs: - check-generated: + auto-generate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -25,4 +25,6 @@ jobs: git add . git commit -m "chore: generate via GitHub action" git push origin HEAD:${{ github.head_ref }} + else + echo "no changes to commit and push" fi diff --git a/parts/linux/cloud-init/artifacts/components.json b/parts/linux/cloud-init/artifacts/components.json index 8fa515e2c03..a705375c6a8 100644 --- a/parts/linux/cloud-init/artifacts/components.json +++ b/parts/linux/cloud-init/artifacts/components.json @@ -48,7 +48,7 @@ "multiArchVersionsV2": [ { "renovateTag": "registry=https://mcr.microsoft.com, name=containernetworking/azure-cni", - "latestVersion": "v1.5.35", + "latestVersion": "v1.5.36", "previousLatestVersion": "v1.5.32", "containerImagePrefetch": { "latestVersion": { From e5d68342848dbe20bd5337919abd757df615a99a Mon Sep 17 00:00:00 2001 From: Cameron Meissner Date: Thu, 26 Sep 2024 11:16:05 -0700 Subject: [PATCH 03/16] chore: debug --- .github/workflows/generate.yaml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index 6c3b22acd30..a0e59ef5953 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -11,20 +11,24 @@ jobs: with: go-version: '1.22' + - name: checkout PR branch + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh pr checkout ${{ github.event.pull_request.number }} + - name: make generate run: make generate - - name: configure git - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - - name: commit and push generated changes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | if [ -n "$(git status --porcelain)" ]; then + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' git add . - git commit -m "chore: generate via GitHub action" - git push origin HEAD:${{ github.head_ref }} + git commit -m "chore: auto-generate via GitHub action" + git push else echo "no changes to commit and push" fi From edd4e28553176a55eb9fe828c6f38c61c9924f1a Mon Sep 17 00:00:00 2001 From: Cameron Meissner Date: Thu, 26 Sep 2024 11:39:51 -0700 Subject: [PATCH 04/16] chore: debug --- .github/workflows/generate.yaml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index a0e59ef5953..d64ebda8b55 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -11,24 +11,17 @@ jobs: with: go-version: '1.22' - - name: checkout PR branch - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh pr checkout ${{ github.event.pull_request.number }} - - - name: make generate - run: make generate - - name: commit and push generated changes env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + make generate if [ -n "$(git status --porcelain)" ]; then - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add . - git commit -m "chore: auto-generate via GitHub action" + git commit -m "chore: auto-generate" git push else echo "no changes to commit and push" - fi + fi \ No newline at end of file From a8759f1533b2db52c318c98482ba5e064a5b6217 Mon Sep 17 00:00:00 2001 From: Cameron Meissner Date: Thu, 26 Sep 2024 11:42:41 -0700 Subject: [PATCH 05/16] chore: debug --- .github/workflows/generate.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index d64ebda8b55..f1a23b15434 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -12,8 +12,6 @@ jobs: go-version: '1.22' - name: commit and push generated changes - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | make generate if [ -n "$(git status --porcelain)" ]; then @@ -21,7 +19,7 @@ jobs: git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add . git commit -m "chore: auto-generate" - git push + git push origin HEAD:${{ github.head_ref }} else echo "no changes to commit and push" fi \ No newline at end of file From fcbb35433e4bd5d47ec45bc44a3588991a8945ef Mon Sep 17 00:00:00 2001 From: Cameron Meissner Date: Thu, 26 Sep 2024 11:56:47 -0700 Subject: [PATCH 06/16] chore: write contents --- .github/workflows/generate.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index f1a23b15434..0dda1ad290b 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -2,6 +2,8 @@ name: auto-generate on: pull_request jobs: + permissions: + contents: write auto-generate: runs-on: ubuntu-latest steps: From d87913d59074d0683a6a389ab7457aeeb60721dd Mon Sep 17 00:00:00 2001 From: Cameron Meissner Date: Thu, 26 Sep 2024 11:58:36 -0700 Subject: [PATCH 07/16] chore: debug --- .github/workflows/generate.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index 0dda1ad290b..65eddeca4cf 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -2,9 +2,9 @@ name: auto-generate on: pull_request jobs: - permissions: - contents: write auto-generate: + permissions: + contents: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 3d482b9972c302a1da62876f34c83f311c51e861 Mon Sep 17 00:00:00 2001 From: Cameron Meissner Date: Thu, 26 Sep 2024 12:01:40 -0700 Subject: [PATCH 08/16] chore: debug --- .github/workflows/generate.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index 65eddeca4cf..eb4b761ed5c 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -15,6 +15,7 @@ jobs: - name: commit and push generated changes run: | + git pull make generate if [ -n "$(git status --porcelain)" ]; then git config user.name "github-actions[bot]" From a1f1dc51fa32c6d3e257783e42bf564f26a84a27 Mon Sep 17 00:00:00 2001 From: Cameron Meissner Date: Thu, 26 Sep 2024 13:26:12 -0700 Subject: [PATCH 09/16] chore: remove perms --- .github/workflows/generate.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index eb4b761ed5c..f1a23b15434 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -3,8 +3,6 @@ on: pull_request jobs: auto-generate: - permissions: - contents: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -15,7 +13,6 @@ jobs: - name: commit and push generated changes run: | - git pull make generate if [ -n "$(git status --porcelain)" ]; then git config user.name "github-actions[bot]" From 22551fa4bef37ec5546b944c5f3742accdc7ded2 Mon Sep 17 00:00:00 2001 From: Cameron Meissner Date: Thu, 26 Sep 2024 13:44:39 -0700 Subject: [PATCH 10/16] chore: debug --- .github/workflows/generate.yaml | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index f1a23b15434..1299c13d272 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -3,6 +3,8 @@ on: pull_request jobs: auto-generate: + permissions: + contents: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -10,16 +12,21 @@ jobs: - uses: actions/setup-go@v3 with: go-version: '1.22' + + - name: make generate + run: make generate - - name: commit and push generated changes + - name: Checkout PR + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh pr checkout ${{ github.event.pull_request.number }} + + - name: Commit and push changes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - make generate - if [ -n "$(git status --porcelain)" ]; then - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add . - git commit -m "chore: auto-generate" - git push origin HEAD:${{ github.head_ref }} - else - echo "no changes to commit and push" - fi \ No newline at end of file + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "chore: auto-generate" + git push \ No newline at end of file From e597f1d64397464e53bb7aaedfcd7c251907c080 Mon Sep 17 00:00:00 2001 From: Cameron Meissner Date: Thu, 26 Sep 2024 13:48:03 -0700 Subject: [PATCH 11/16] chore: debug --- .github/workflows/generate.yaml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index 1299c13d272..8c1c4f4d2f8 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -7,21 +7,19 @@ jobs: contents: write runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v3 with: go-version: '1.22' - - - name: make generate - run: make generate - - name: Checkout PR + - name: checkout PR branch env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: gh pr checkout ${{ github.event.pull_request.number }} + + - name: make generate + run: make generate - - name: Commit and push changes + - name: push changes env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | From e1cb2f10b0acfacce0d2a02f859b509989b947e1 Mon Sep 17 00:00:00 2001 From: Cameron Meissner Date: Thu, 26 Sep 2024 13:50:09 -0700 Subject: [PATCH 12/16] chore: debug --- .github/workflows/generate.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index 8c1c4f4d2f8..d31bd955370 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -7,19 +7,16 @@ jobs: contents: write runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v3 with: go-version: '1.22' - - - name: checkout PR branch - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh pr checkout ${{ github.event.pull_request.number }} - name: make generate run: make generate - - name: push changes + - name: commit and push env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | From 59f08bd23565524656c26b93ca07814b6f3fb919 Mon Sep 17 00:00:00 2001 From: Cameron Meissner Date: Thu, 26 Sep 2024 13:52:33 -0700 Subject: [PATCH 13/16] chore: debug --- .github/workflows/generate.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index d31bd955370..e7c66b872b1 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -8,6 +8,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} - uses: actions/setup-go@v3 with: From 4b78a1098f54af735a45f446c2169fed5778c028 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 20:54:10 +0000 Subject: [PATCH 14/16] chore: auto-generate --- .../prefetch/internal/containerimage/testdata/components.json | 2 +- .../prefetch/internal/containerimage/testdata/prefetch.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vhdbuilder/prefetch/internal/containerimage/testdata/components.json b/vhdbuilder/prefetch/internal/containerimage/testdata/components.json index 8fa515e2c03..a705375c6a8 100644 --- a/vhdbuilder/prefetch/internal/containerimage/testdata/components.json +++ b/vhdbuilder/prefetch/internal/containerimage/testdata/components.json @@ -48,7 +48,7 @@ "multiArchVersionsV2": [ { "renovateTag": "registry=https://mcr.microsoft.com, name=containernetworking/azure-cni", - "latestVersion": "v1.5.35", + "latestVersion": "v1.5.36", "previousLatestVersion": "v1.5.32", "containerImagePrefetch": { "latestVersion": { diff --git a/vhdbuilder/prefetch/internal/containerimage/testdata/prefetch.sh b/vhdbuilder/prefetch/internal/containerimage/testdata/prefetch.sh index 8c18236518a..058ad621dd2 100755 --- a/vhdbuilder/prefetch/internal/containerimage/testdata/prefetch.sh +++ b/vhdbuilder/prefetch/internal/containerimage/testdata/prefetch.sh @@ -17,7 +17,7 @@ prefetch() { ctr -n k8s.io images unmount "$mount_dir" } -prefetch "mcr.microsoft.com/containernetworking/azure-cni:v1.5.35" "/dropgz" +prefetch "mcr.microsoft.com/containernetworking/azure-cni:v1.5.36" "/dropgz" prefetch "mcr.microsoft.com/containernetworking/azure-cni:v1.5.32" "/dropgz" prefetch "mcr.microsoft.com/containernetworking/azure-cni:v1.6.7" "/dropgz" prefetch "mcr.microsoft.com/containernetworking/azure-cni:v1.6.5" "/dropgz" From 29972d17015f10a07deab634725c383d94bce722 Mon Sep 17 00:00:00 2001 From: Cameron Meissner Date: Thu, 26 Sep 2024 14:03:19 -0700 Subject: [PATCH 15/16] chore: remove perms --- .github/workflows/generate.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index e7c66b872b1..f94c7db3a8d 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -3,8 +3,6 @@ on: pull_request jobs: auto-generate: - permissions: - contents: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From a1b39d147ed76d72dd7fc404f577a82a55073d74 Mon Sep 17 00:00:00 2001 From: Cameron Meissner Date: Thu, 26 Sep 2024 14:07:43 -0700 Subject: [PATCH 16/16] chore: debug --- .github/workflows/generate.yaml | 5 +++++ parts/linux/cloud-init/artifacts/components.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index f94c7db3a8d..15bd3cb8957 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -20,6 +20,11 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + if git diff-index --quiet HEAD; then + echo "no changes detected, nothing to commit" + exit 0 + fi + git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add . diff --git a/parts/linux/cloud-init/artifacts/components.json b/parts/linux/cloud-init/artifacts/components.json index f20ab92324d..5935492c2f7 100644 --- a/parts/linux/cloud-init/artifacts/components.json +++ b/parts/linux/cloud-init/artifacts/components.json @@ -88,7 +88,7 @@ "multiArchVersionsV2": [ { "renovateTag": "registry=https://mcr.microsoft.com, name=containernetworking/azure-cns", - "latestVersion": "v1.4.52", + "latestVersion": "v1.4.53", "containerImagePrefetch": { "latestVersion": { "binaries": [