-
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #202 from dflook/large-plan
Truncate large plans in PR comments
- Loading branch information
Showing
4 changed files
with
121 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -841,7 +841,7 @@ jobs: | |
- name: Plan | ||
uses: ./terraform-plan | ||
with: | ||
label: test-apply warnings (hash) | ||
label: test-apply warnings_hash | ||
path: tests/workflows/test-apply/warnings | ||
|
||
- name: Create warning | ||
|
@@ -851,7 +851,7 @@ jobs: | |
- name: Apply | ||
uses: ./terraform-apply | ||
with: | ||
label: test-apply warnings (hash) | ||
label: test-apply warnings_hash | ||
path: tests/workflows/test-apply/warnings | ||
|
||
warnings_text: | ||
|
@@ -866,7 +866,7 @@ jobs: | |
- name: Plan | ||
uses: dflook/[email protected] | ||
with: | ||
label: test-apply warnings (text) | ||
label: test-apply warnings_text | ||
path: tests/workflows/test-apply/warnings | ||
|
||
- name: Create warning | ||
|
@@ -876,5 +876,63 @@ jobs: | |
- name: Apply | ||
uses: ./terraform-apply | ||
with: | ||
label: test-apply warnings (text) | ||
label: test-apply warnings_text | ||
path: tests/workflows/test-apply/warnings | ||
|
||
long_plan: | ||
runs-on: ubuntu-latest | ||
name: Apply a plan that doesn't fit in a comment | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Plan | ||
uses: ./terraform-plan | ||
with: | ||
label: test-apply long_plan | ||
path: tests/workflows/test-apply/long_plan | ||
|
||
- name: Apply | ||
uses: ./terraform-apply | ||
with: | ||
label: test-apply long_plan | ||
path: tests/workflows/test-apply/long_plan | ||
|
||
long_plan_changes: | ||
runs-on: ubuntu-latest | ||
name: Don't apply a changed plan that doesn't fit in a comment | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Plan | ||
uses: ./terraform-plan | ||
with: | ||
label: test-apply long_plan_changes | ||
path: tests/workflows/test-apply/long_plan | ||
|
||
- name: Apply | ||
uses: ./terraform-apply | ||
id: apply | ||
continue-on-error: true | ||
with: | ||
label: test-apply long_plan_changes | ||
path: tests/workflows/test-apply/long_plan | ||
variables: | | ||
length = 2 | ||
- name: Check failed to apply | ||
run: | | ||
if [[ "${{ steps.apply.outcome }}" != "failure" ]]; then | ||
echo "Apply did not fail correctly" | ||
exit 1 | ||
fi | ||
if [[ "${{ steps.apply.outputs.failure-reason }}" != "plan-changed" ]]; then | ||
echo "::error:: failure-reason not set correctly" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
resource "random_id" "a" { | ||
count = 250 | ||
|
||
byte_length = 3 | ||
} | ||
|
||
resource "random_id" "b" { | ||
byte_length = var.length | ||
} | ||
|
||
variable "length" { | ||
type = number | ||
default = 3 | ||
} |