Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support asdf install in subdirectories #584

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

afirth
Copy link

@afirth afirth commented Jul 23, 2024

  • 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 #83
IMO also solves #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 afirth force-pushed the 2024-07-23-support-subdir branch from 086ce59 to 57d8bcc Compare July 23, 2024 12:18
@afirth afirth changed the title Support asdf install in subdirectories feat Support asdf install in subdirectories Jul 23, 2024
@afirth afirth changed the title feat Support asdf install in subdirectories feat: Support asdf install in subdirectories Jul 23, 2024
@afirth afirth marked this pull request as ready for review July 23, 2024 12:26
@afirth afirth requested a review from jthegedus as a code owner July 23, 2024 12:26
@afirth
Copy link
Author

afirth commented Jul 23, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Install action does not honor working-directory
1 participant