Commit 86bfa73
Add skip-plandiff option and fix workspace variable usage (#89)
* Replace github.workspace with GITHUB_WORKSPACE
${{ github.workspace }} is evaluated at workflow parse time, not runtime, so it always resolves to /home/runner/_work/repo/repo regardless of where it's actually mounted in the container.
* Update action.yml
* Update action.yml
* Add conditional check for Atmos version installation
* Add skip-plandiff input to bypass plan validation
This commit introduces a new `skip-plandiff` input parameter that allows users to skip the plan diff validation step and proceed directly to terraform apply.
Changes:
- Add `skip-plandiff` input parameter (default: 'false')
- Update "Plan prepare" step to skip when skip-plandiff is enabled
- Update all dependent steps (Infracost, Apply) to pass when skip-plandiff is true
- Ensure Terraform Apply step runs when plan validation is skipped
Use case: This is useful when you want to force an apply operation without waiting for or validating plan changes, such as in emergency deployments or when plan diff validation is not required.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix plan file selection to support skip-plandiff option
This commit fixes an issue where steps would fail when skip-plandiff
is enabled because they referenced a plan file that was never created.
Problem:
- When skip-plandiff is true, the "Plan prepare" step doesn't run
- The renewed_plan_file is never created
- Subsequent steps (Convert PLANFILE to JSON, Terraform Apply) failed
trying to reference the non-existent renewed_plan_file
Solution:
- Add "Determine Plan File" step that conditionally sets the plan file:
* If skip-plandiff is true: use retrieved_plan_file (from storage)
* If skip-plandiff is false: use renewed_plan_file (from plan prepare)
- Update "Convert PLANFILE to JSON" to use dynamic plan file
- Update "Terraform Apply" to use dynamic plan filename
This ensures plan-diff still works as expected while also supporting
the skip-plandiff option for emergency deployments.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Matching plan action cache
* Fix Debug on infracost condition
* Fix Debug on infracost condition
* Make --skip-init conditional based on skip-plandiff
Problem:
- When skip-plandiff is true, the "Plan prepare" step doesn't run
- This means terraform init never executes
- But the deploy command was always using --skip-init
- This caused "Error: Backend initialization required" failures
Solution:
- Only add --skip-init flag when plan-diff actually ran
- When skip-plandiff is true, allow init to run during deploy
- Set SKIP_INIT_FLAG conditionally based on skip-plandiff input
Also removed debug line that was accidentally left in the code.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix skip-init when skip-diff is enable and deleting unused base_cmd variable in apply step
* Fix skip-init when skip-diff is enable and deleting unused base_cmd variable in apply step
* Fix cache key additional ./ on dir
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 1127e95 commit 86bfa73
1 file changed
Lines changed: 48 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
| |||
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
| 85 | + | |
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
| |||
342 | 347 | | |
343 | 348 | | |
344 | 349 | | |
345 | | - | |
| 350 | + | |
346 | 351 | | |
347 | 352 | | |
348 | 353 | | |
| |||
368 | 373 | | |
369 | 374 | | |
370 | 375 | | |
371 | | - | |
| 376 | + | |
372 | 377 | | |
373 | 378 | | |
374 | 379 | | |
| |||
384 | 389 | | |
385 | 390 | | |
386 | 391 | | |
387 | | - | |
| 392 | + | |
388 | 393 | | |
389 | 394 | | |
390 | 395 | | |
| |||
420 | 425 | | |
421 | 426 | | |
422 | 427 | | |
423 | | - | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
424 | 442 | | |
425 | 443 | | |
426 | | - | |
| 444 | + | |
427 | 445 | | |
428 | 446 | | |
429 | 447 | | |
| |||
433 | 451 | | |
434 | 452 | | |
435 | 453 | | |
436 | | - | |
| 454 | + | |
437 | 455 | | |
438 | 456 | | |
439 | 457 | | |
440 | 458 | | |
441 | 459 | | |
442 | | - | |
| 460 | + | |
443 | 461 | | |
444 | 462 | | |
445 | 463 | | |
446 | | - | |
| 464 | + | |
447 | 465 | | |
448 | 466 | | |
449 | | - | |
| 467 | + | |
450 | 468 | | |
451 | 469 | | |
452 | 470 | | |
| |||
462 | 480 | | |
463 | 481 | | |
464 | 482 | | |
465 | | - | |
| 483 | + | |
466 | 484 | | |
467 | 485 | | |
468 | 486 | | |
| |||
471 | 489 | | |
472 | 490 | | |
473 | 491 | | |
474 | | - | |
| 492 | + | |
475 | 493 | | |
476 | 494 | | |
477 | 495 | | |
| |||
488 | 506 | | |
489 | 507 | | |
490 | 508 | | |
491 | | - | |
| 509 | + | |
492 | 510 | | |
493 | 511 | | |
494 | 512 | | |
495 | 513 | | |
496 | 514 | | |
497 | 515 | | |
498 | | - | |
499 | | - | |
| 516 | + | |
| 517 | + | |
500 | 518 | | |
501 | 519 | | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
502 | 526 | | |
503 | 527 | | |
504 | 528 | | |
| |||
509 | 533 | | |
510 | 534 | | |
511 | 535 | | |
512 | | - | |
| 536 | + | |
513 | 537 | | |
514 | 538 | | |
515 | 539 | | |
516 | 540 | | |
517 | 541 | | |
518 | 542 | | |
519 | 543 | | |
520 | | - | |
521 | | - | |
| 544 | + | |
| 545 | + | |
522 | 546 | | |
523 | 547 | | |
524 | 548 | | |
| |||
535 | 559 | | |
536 | 560 | | |
537 | 561 | | |
538 | | - | |
| 562 | + | |
539 | 563 | | |
540 | 564 | | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
545 | 569 | | |
546 | | - | |
| 570 | + | |
547 | 571 | | |
548 | 572 | | |
549 | 573 | | |
| |||
554 | 578 | | |
555 | 579 | | |
556 | 580 | | |
557 | | - | |
| 581 | + | |
558 | 582 | | |
559 | 583 | | |
560 | 584 | | |
| |||
0 commit comments