Closed yindia closed 1 year ago
I think this is happening because of gh core package has trim logic https://github.com/dagger/dagger-for-github/blob/093b23cf2e08492434fb6aa0c3ecff36512a30d9/dist/index.js#L487
Thanks for your issue. I think you're right.
To unlock you right now, you can base yourself on the CI of the Go on Docker Swarm
use case: https://docs.dagger.io/1211/go-docker-swarm/.
It is different because it just installs dagger
instead of directly executing it. You won't have the escape happening:
name: Dagger/docs.particubes.com
on:
push:
branches: [master]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Dagger
uses: dagger/dagger-action@v2
with:
install-only: true
- name: Dagger project update
run: dagger project update
- name: Dagger do <youraction>
run: dagger do test --log-format plain # Write same command as your local one
We worked around this today by using a one-liner to generate our --with
CUE and using install-only
because it seemed like the action was choking on the first comma in our CUE array in the --with
.
Work around:
- name: Get Dirs
run: |
echo "SUBDIRS=$(ls -m mydir | tr -d "[:space:]" | sed 's/[^,]*/"&"/g;S/^/ [/:S/$/]/ ')" >> $GITHUB ENV
- name: Install Dagger
uses: dagger/dagger-action@v3
with:
install-only: true
- name: Deploy to using subdir contents
run: |
dagger do -p my.cue deploy --log-format plain -with 'actions:deploy:dirs: ${{env.SUBDIRS}}'
Usage example of --with
added to README.md
What is the issue?
I have a small pipeline that build & push images in docker hub, I tested it locally and it worked fine but when i try to use it in CI it is failing
CI action will convert the command from
dagger do build -l debug --log-format plain --with 'actions: params: image: tag: "v0.2.0"'
to/opt/hostedtoolcache/dagger/0.2.4/x64/dagger do build -l debug --log-format plain --with 'actions: params: image: tag: v0.2.0' --log-format plain
And that's wrong if you add double quotes to tag then it will work fine.
Log output
Steps to reproduce
Build Failure: https://github.com/evalsocket/dagger-flyte/runs/5816670062?check_suite_focus=true#step:4:1
Successful Build: https://github.com/evalsocket/dagger-flyte/runs/5816717792?check_suite_focus=true#step:4:1
Dagger version
v0.2.4
OS version
MacOs 12.2.1