chore: release 3.6.0 #428
Workflow file for this run
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: | |
pull_request: | |
types: | |
- edited | |
- opened | |
- synchronize | |
- reopened | |
jobs: | |
find-changed-dirs: | |
runs-on: [ARM64,self-hosted,Linux] | |
outputs: | |
allChanges: ${{ steps.changedDirs.outputs.allChanges }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
initial-fetch-depth: '1' | |
list-files: json | |
filters: | | |
changed: | |
- added|modified: 'terraform/**' | |
- uses: actions/github-script@v6 | |
id: changedDirs | |
with: | |
script: | | |
const path = require("path") | |
const changedFiles = ${{ steps.filter.outputs.changed_files }} | |
const changedDirs = changedFiles.map(f => path.dirname(f)) | |
console.log(`Found the following changed dirs: ${JSON.stringify(changedDirs, null, 2)}\n OG: ${JSON.stringify(changedFiles, null, 2)} `) | |
const changedModules = [... new Set(changedDirs.filter(d => d.indexOf("modules") !== -1 && d.split("/").length === 3))] | |
const changedAccounts = [... new Set(changedDirs.filter(d => d.indexOf("accounts") !== -1 && d.split("/").length === 3))] | |
const changedEnvs = [... new Set(changedDirs.filter(d => d.indexOf("envs") !== -1 && d.split("/").length === 4))] | |
const allChanges = [...changedAccounts,...changedEnvs, ...changedModules] | |
console.log(`changedModules: ${JSON.stringify(changedModules)}`) | |
console.log(`changedAccounts: ${JSON.stringify(changedAccounts)}`) | |
console.log(`changedEnvs: ${JSON.stringify(changedEnvs)}`) | |
core.setOutput("allChanges", allChanges) | |
tf-test-changed-dirs: | |
runs-on: [ARM64,self-hosted,Linux] | |
needs: find-changed-dirs | |
strategy: | |
matrix: | |
workspace: ${{ fromJson(needs.find-changed-dirs.outputs.allChanges) }} | |
if: ${{ needs.find-changed-dirs.outputs.allChanges != '[]' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Terraform plan | |
uses: ./.github/actions/tf-plan | |
with: | |
ssh-private-key: ${{secrets.SHARED_INFRA_DEPLOY_KEY}} | |
working-dir: ${{matrix.workspace}} | |
tf-version: 1.3.0 | |
tfe-token: ${{secrets.TFE_TOKEN}} |