Skip to content

Commit

Permalink
Merge pull request #7 from gogaille/terraform-1.2-compatibility
Browse files Browse the repository at this point in the history
terraform 1.2 compatibility
  • Loading branch information
Sébastien HOUZÉ authored May 19, 2022
2 parents 0d3cd61 + 73f532a commit dc6fb96
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,20 @@ runs:
)
echo "📝 generate drift details"
drift=$(
echo -e "$plan" | \
tail -n +$(
driftSeparatorLineNumber=$(
echo -e "$plan" | \
grep -nE 'Terraform detected the following changes made outside of Terraform' | cut -d':' -f1
) | sed '1,/─────────────────────────────────────────────────────────────────────────────/!d' | head -n -2
)
grep -nE 'Terraform detected the following changes made outside of Terraform' | cut -d':' -f1
) || true
if [ -z "$driftSeparatorLineNumber" ]; then
echo "🚫 no drift detected"
drift=""
else
drift=$(
echo -e "$plan" | \
tail -n +$driftSeparatorLineNumber | sed '1,/─────────────────────────────────────────────────────────────────────────────/!d' | head -n -2
)
fi
echo "🎁 wrap plan into HTML"
message=$(printf "
Expand Down

0 comments on commit dc6fb96

Please sign in to comment.