karancode / kustomize-github-action

:european_castle: Github action for kustomize
https://github.com/marketplace/actions/kustomize-github-action
MIT License
44 stars 28 forks source link

[BUG] There is a version that we cannot get. #22

Closed m3y closed 3 years ago

m3y commented 3 years ago

Describe the bug Only the following versions of kustomize are not available

To Reproduce

name: 'Kustomize GitHub Actions'
on:
  - pull_request
jobs:
  kustomize:
    name: 'Kustomize'
    runs-on: ubuntu-latest
    steps:
      - name: 'Checkout'
        uses: actions/checkout@master
      - name: 'Kustomize Build'
        uses: karancode/kustomize-github-action@v1.1.0
        with:
          kustomize_version: '3.2.3'
          kustomize_build_dir: '.'
          kustomize_comment: true
          kustomize_output_file: "gitops/rendered.yaml"
          enable_alpha_plugins: true
        env:
          GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expected behavior kustomize is available for download

Running on:

Additional context There are three patterns of kustomize download URLs 😵 Before 3.2.0

https://github.com/kubernetes-sigs/kustomize/releases/download/v3.2.0/kustomize_3.2.0_linux_amd64

3.3.0 and later

https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.3.0/kustomize_v3.3.0_linux_amd64.tar.gz

3.2.1 to 3.2.3 😞

https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.2.3/kustomize_kustomize.v3.2.3_linux_amd64
karancode commented 3 years ago

@m3y thank you so much for opening this bug. Will update for these cases as well.!

karancode commented 3 years ago

@dan-slinky-ckpd fyi!

dan-slinky-ckpd commented 3 years ago

@karancode Thanks, sorry I missed those. Minor tweak to the jq regex needed, I'll submit a PR later this morning.

Like so:

curl -s "https://api.github.com/repos/kubernetes-sigs/kustomize/releases?per_page=100" | jq -r '.[].assets[] | select(.browser_download_url | test("kustomize(_|.)?(v)?([0-9])+.([0-9])+.([0-9]+).*_darwin_amd64")) | .browser_download_url'
karancode commented 3 years ago

Thank you @m3y @dan-slinky-ckpd again. I have cut out a new tag with these fixes. Please use v1.1.1 😃

m3y commented 3 years ago

Thank you @karancode @dan-slinky-ckpd 😃