Skip to content

Cloud run job issue with parsing flags #514

Description

@AdeelK93

TL;DR

This GHA replaces = separated flags with space separate flags, which can cause parsing issues.

Expected behavior

If I add in the flags --command=python --args='-m,job.main', the output gcloud command should also be = separated, which would result in a successful deploy.

Observed behavior

The = gets replaced by a space by GHA, and the resultant flag sent to gcloud looks like --command python --args -m,job.main. That leading dash for -m causes a shell parsing error, which looks like:

ERROR: (gcloud.run.jobs.deploy) argument --args: expected one argument

Action YAML

- name: Deploy to Cloud Run
  uses: google-github-actions/deploy-cloudrun@v2
  with:
    job: test
    region: us-east1
    flags: --command=python --args=-m,job.main

Log output

Error: google-github-actions/deploy-cloudrun failed with: failed to execute gcloud command `gcloud run jobs deploy test ... --command python --args -m,job.main`: ERROR: (gcloud.run.jobs.deploy) argument --args: expected one argument

Additional information

This is only an issue if the first arg starts with a dash

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions