feat(SYNC-MODULES): Add modules syncronization with le-tf-infra-aws repo #1
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
on: | |
workflow_dispatch: | |
pull_request: | |
types: [opened, reopened, synchronize, labeled, unlabeled] | |
jobs: | |
management_layer: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
modules: [ | |
["management/global/sso/account_assignments.tf", "management/global/sso/account_assignments.tf"], | |
["management/us-east-1/base-tf-backend/main.tf", "management/primary_region/base-tf-backend/main.tf"] | |
] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Clone le-tf-infra-aws repo | |
run: | | |
cd ../ | |
git clone [email protected]:binbashar/le-tf-infra-aws.git | |
- name: Sync modules | |
run: | | |
cd le-tf-infra-aws-template | |
chmod +x sync_modules.sh | |
./sync_modules.sh ${{ matrix.modules[0] }} ${{ matrix.modules[1] }} | |
git add ${{ matrix.modules[1] }} | |
git commit -m "Sync ${{ matrix.modules[1] }} module" | |
- name: Create PR | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "Sync ${{ matrix.modules[1] }} module" | |
title: "Sync Management Layer modules" | |
body: "Sync ${{ matrix.modules[0] }} and ${{ matrix.modules[1] }} modules" | |
branch: "sync-management-layer-modules" | |
base: "main" | |
labels: "enhancement" |