Skip to content

Don't fail on deploys that only push config files (cron.yaml, dispatch.yaml) - #400

Open
rootkiller6788 wants to merge 3 commits into
google-github-actions:mainfrom
rootkiller6788:fix-config-only-deploy
Open

rootkiller6788 wants to merge 3 commits into
google-github-actions:mainfrom
rootkiller6788:fix-config-only-deploy

Conversation

@rootkiller6788

Copy link
Copy Markdown

Fixes #353.

Deploying only cron.yaml or dispatch.yaml does work, but the step fails right after the deploy finishes: gcloud prints an empty "versions" list because no new version gets created, and we treated that as an unparseable response. Same repro for dispatch.yaml as reported in the comments.

So I made the parser accept that shape as long as gcloud listed at least one config, and made run() skip the "app versions describe" call when there is no version to describe. The version outputs just stay unset in that case, which seems more honest than filling them with empty strings.

A response with neither versions nor configs (including the existing [] and {} cases) still throws, so genuinely broken output is not being swallowed.

Tests: added cases for the exact stdout from the report, dispatch-only, version+configs together, and versions+configs both empty; npm test passes 55/55 and eslint is clean. Rebuilt dist.

When you deploy only config files such as cron.yaml or dispatch.yaml,
gcloud prints an empty "versions" list because no new version was
created. The deploy itself succeeded, but the parser treated that as an
error and failed the whole step.

Accept an empty versions list as long as gcloud listed at least one
config, and keep the configs on the response so callers know what was
deployed.
For config-only deploys there is no version to describe, so bail out
before running "gcloud app versions describe" with empty values. The
version outputs stay unset, which is the honest answer here.

Also made the parseDeployResponse mock in the tests synchronous, since
the real function is.
@rootkiller6788
rootkiller6788 marked this pull request as ready for review November 26, 2026 11:31
@rootkiller6788
rootkiller6788 requested a review from a team as a code owner November 26, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Deploying only cron.yaml fails on output parsing

1 participant