actions icon indicating copy to clipboard operation
actions copied to clipboard

feat: Support asdf install in subdirectories

Open afirth opened this issue 1 year ago • 1 comments

  • add a new directory option for asdf-install action
    • ensure this is a subdir to avoid sandbox escape
  • fix yaml for install action so it's valid

should /fixes https://github.com/asdf-vm/actions/issues/83 IMO also solves https://github.com/asdf-vm/actions/issues/84 as you can just call it multiple times

Use case: have k8s deploy manifests+tooling living with the code. Don't need to install the dev tooling to deploy it in CI (or locally), and devs don't need to install the deploy tooling just to work with the code (since it automatically deploys on merge).

complete example:

on: push
name: lint
jobs:
  lint:
    name: k8s lint manifests
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - stage: dev
            cluster: platform-development
          - stage: prod
            cluster: platform-production
    defaults:
      run:
        working-directory: ./deploy
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Install CD tools from .tool-versions
        if: steps.asdf-cache.outputs.cache-hit != 'true'
        uses: FATMAP/asdf-vm-actions/install@2021-06-16-chdir
        with:
          directory: ./deploy # << :tada: 

      - name: kustomize
        env:
          CLUSTER: ${{ matrix.cluster }}
          STAGE: ${{ matrix.stage }}
        run: |
          kustomize build --load-restrictor=LoadRestrictionsNone clusters/$STAGE/$CLUSTER > ./manifest.yaml

      - name: lint
        uses: instrumenta/kubeval-action@master
        with:
          files: deploy/manifest.yaml

supersedes #326

afirth avatar Jul 23 '24 12:07 afirth

Edit: I see #446 is open already too. Take your pick @jthegedus :pray:

afirth avatar Jul 23 '24 12:07 afirth