Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into h24s
Browse files Browse the repository at this point in the history
  • Loading branch information
H1rono committed Jun 13, 2024
2 parents 0a9c07c + ce3e7b5 commit d7486d7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@ on:
push:
branches:
- main
workflow_dispatch:

concurrency:
group: terraform

jobs:
check_condition:
runs-on: ubuntu-latest
steps:
- name: Check if the branch is main
if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main'
run: exit 1

apply:
needs: check_condition
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ jobs:
with:
script: |
const message = `${{ steps.plan.outputs.stdout }}`;
let filteredMessage = "`terraform plan`\n```\n" + message.split('\n').filter(line => !line.includes('Refreshing state...')).filter(line => !line.includes('Note:')).join('\n') + "\n```";
let filteredMessage = "`terraform plan`\n<details>\n\n```\n" + message.split('\n').filter(line => !line.includes('Refreshing state...')).filter(line => !line.includes('Note:')).join('\n') + "\n```\n\n</details>";
if (filteredMessage.Length > 65535) {
console.log("Plan output is too long, truncating...");
filteredMessage = filteredMessage.substring(0, 65400);
filteredMessage = filteredMessage.substring(0, 65400) + "\n</details>";
filteredMessage += "\n```\n\nPlan output was too long and was truncated. Please check the actions log";
}
Expand Down

0 comments on commit d7486d7

Please sign in to comment.