From effdbcd48057346afbe3a72b3700c7455e3ea30f Mon Sep 17 00:00:00 2001 From: 0katrinpetrosyan0 Date: Fri, 10 Jun 2022 13:57:02 +0400 Subject: [PATCH] add if for target branch --- examples/terraform/.github/workflows/master-merge.yml | 2 +- examples/terraform/.github/workflows/master-pr.yml | 2 +- terraform/README.md | 9 +++++---- terraform/action.yml | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/terraform/.github/workflows/master-merge.yml b/examples/terraform/.github/workflows/master-merge.yml index 271a7d5..0978715 100644 --- a/examples/terraform/.github/workflows/master-merge.yml +++ b/examples/terraform/.github/workflows/master-merge.yml @@ -19,7 +19,7 @@ jobs: - project2 steps: - name: Plan stage ${{ matrix.path }} - uses: dasmeta/reusable-actions-workflows/terraform@0.2.4 + uses: dasmeta/reusable-actions-workflows/terraform@0.3.2 with: post-plan-to-github-pr: 'false' do-apply: 'true' diff --git a/examples/terraform/.github/workflows/master-pr.yml b/examples/terraform/.github/workflows/master-pr.yml index 05a6a0b..47cb2ed 100644 --- a/examples/terraform/.github/workflows/master-pr.yml +++ b/examples/terraform/.github/workflows/master-pr.yml @@ -22,7 +22,7 @@ jobs: - project2 steps: - name: Publish stage terraform plan result into PR - uses: dasmeta/reusable-actions-workflows/terraform@0.2.4 + uses: dasmeta/reusable-actions-workflows/terraform@0.3.2 with: post-plan-to-github-pr: 'true' fetch-depth: 100 diff --git a/terraform/README.md b/terraform/README.md index 043eb4e..7bb317c 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -7,7 +7,7 @@ This action can be used as follows add latest version: ```yaml - name: Publish terraform plan result into PR - uses: dasmeta/reusable-actions-workflows/terraform@0.2.4 + uses: dasmeta/reusable-actions-workflows/terraform@0.3.2 ``` ## For Default Configuration in .github/workflows/check.yml you must have: @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Publish terraform plan result into PR - uses: dasmeta/reusable-actions-workflows/terraform@0.2.4 + uses: dasmeta/reusable-actions-workflows/terraform@0.3.2 with: github-token: ${{ secrets.GITHUB_TOKEN }} aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -102,10 +102,11 @@ jobs: - sample-path-to-terraform-project-sources steps: - name: Publish terraform plan result into PR - uses: dasmeta/reusable-actions-workflows/terraform@0.2.4 + uses: dasmeta/reusable-actions-workflows/terraform@0.3.2 with: fetch-depth: 100 post-plan-to-github-pr: 'true' + target_branch: "release" path: terraform/${{ matrix.path }} github-token: ${{ secrets.GITHUB_TOKEN }} aws-region: ${{ secrets.AWS_DEFAULT_REGION }} @@ -138,7 +139,7 @@ jobs: - sample-path-to-terraform-project-sources steps: - name: Plan stage ${{ matrix.path }} - uses: dasmeta/reusable-actions-workflows/terraform@0.2.4 + uses: dasmeta/reusable-actions-workflows/terraform@0.3.2 with: post-plan-to-github-pr: 'false' do-apply: 'true' diff --git a/terraform/action.yml b/terraform/action.yml index de14761..098f21c 100644 --- a/terraform/action.yml +++ b/terraform/action.yml @@ -60,6 +60,7 @@ runs: fetch-depth: ${{ inputs.fetch-depth }} - name: Merge branches + if: ${{inputs.target_branch}} uses: devmasx/merge-branch@master with: type: now