Skip to content

Adding support to set the workdir #280

Open
KingBain wants to merge 4 commits intochainguard-images:mainfrom
KingBain:main
Open

Adding support to set the workdir #280
KingBain wants to merge 4 commits intochainguard-images:mainfrom
KingBain:main

Conversation

@KingBain
Copy link

@KingBain KingBain commented Feb 27, 2026

Found I needed to specify the workdir in my pipelines, but the apko build action defaulted to --workdir ${{ github.workspace }} \

I needed a way to change the workdir.

This change adds an additional input variable:

        with:
          workdir: /fish/sauce

if the value isnt set then the default remains as ${{ github.workspace }}

This change matches other changuard actions. melange build actions

example of usage

      - uses: chainguard-dev/actions/melange-build@3e8a2a226fad9e1ecbf2d359b8a7697554a4ac6d # v1.5.10
        with:
          workdir: ${{ matrix.dir }}
          config: melange.yaml
          sign-with-temporary-key: true
          signing-key-path: ${{ github.workspace }}/melange.rsa
          repository-path: ${{ github.workspace }}/${{ matrix.dir }}/packages
          

      - uses: KingBain/chainguard-actions/apko-build@547119fc84ae95d1f0953bf4c753648a38365581
        with:
          workdir: ${{ matrix.dir }}
          config: apko.yaml
          tag: ${{ matrix.package }}:${{ steps.snapshot-date.outputs.date }}-${{ github.sha }}
          keyring-append: ${{ github.workspace }}/melange.rsa.pub
          archs: x86_64
          source-date-epoch: ${{ needs.setup.outputs.snapshot-epoch }}

@KingBain KingBain changed the title adding support to set the workdir Adding support to set the workdir Feb 27, 2026
@xnox
Copy link

xnox commented Feb 27, 2026

Hi,

Thank you for this. We will look into this, and either land this change in private repo that will get mirrored here; or will figure out a better place for these. As possibly these are overdue to move to chainguard-dev/actions repo.

Have a lovely weekend!

@xnox xnox self-assigned this Feb 27, 2026
@KingBain
Copy link
Author

Sorry about that @xnox I wasnt sure which repo was upstream and down stream, I had seen this comment and thought chainguard-images was your more production(?) repo .

@xnox
Copy link

xnox commented Feb 28, 2026

Sorry about that @xnox I wasnt sure which repo was upstream and down stream, I had seen this comment and thought chainguard-images was your more production(?) repo .

Just keep this pull requests as is. We have so many repos, that probably I am confused myself what is where :-)

we do have multiple actions repos in multiple orgs, and many similar actions all over the place. Hence will check where this needs to land to propagate everywhere. Plus this will need to be tested as CI of GitHub actions themselves is complicated.

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.

2 participants