Skip to content

Commit

Permalink
Merge pull request #276 from signalwire/fix/runner-permissions-iac
Browse files Browse the repository at this point in the history
Fix/runner-permissions-iac
  • Loading branch information
lucasmellos authored May 6, 2024
2 parents f649a2e + 6cf4b31 commit 5788520
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions .github/workflows/iac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
TG_VERSION:
required: false
type: string
default: '0.57.5'
default: '0.58.2'
TF_VERSION:
required: false
type: string
Expand Down Expand Up @@ -107,19 +107,29 @@ jobs:
environment:
name: ${{ inputs.ENVIRONMENT }}

permissions: write-all
permissions:
contents: 'read'
id-token: 'write'

steps:
- name: Install dependencies
run: |
sudo apt update
sudo apt install unzip git -yq
- name: cleanup old checkout
run: chmod +w -R ${GITHUB_WORKSPACE}; rm -rf ${GITHUB_WORKSPACE}/*;

- name: 'Checkout'
uses: actions/checkout@v4

- name: Checkout actions
uses: actions/checkout@v4
with:
repository: signalwire/actions-template
ref: main
path: actions

- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
Expand All @@ -136,9 +146,6 @@ jobs:
project_id: ${{ inputs.PROJECT_ID }}
service_account: ${{ inputs.GCP_SA }}

- name: Install dependencies
run: sudo apt update ; sudo apt install unzip -yq

- name: Sops Binary Installer
uses: mdgreenwald/[email protected]
with:
Expand Down Expand Up @@ -170,11 +177,9 @@ jobs:

- uses: opentofu/setup-opentofu@main

- run: sudo apt update ; sudo apt install git -yq ; git config --global --add safe.directory '*'

- name: Init
id: init
uses: gruntwork-io/terragrunt-action@v2
uses: gruntwork-io/terragrunt-action@v2.1.1
with:
tf_version: ${{ inputs.TF_VERSION }}
tg_version: ${{ inputs.TG_VERSION }}
Expand Down Expand Up @@ -202,6 +207,7 @@ jobs:
- name: Plan
uses: gruntwork-io/terragrunt-action@v2
id: plan
continue-on-error: true
with:
tf_version: ${{ inputs.TF_VERSION }}
tg_version: ${{ inputs.TG_VERSION }}
Expand All @@ -226,10 +232,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
# TF_LOG: trace

- name: Terraform Plan Status
if: steps.plan.outcome == 'failure'
run: exit 1

- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
Expand Down Expand Up @@ -272,3 +274,5 @@ jobs:
OVH_APPLICATION_SECRET: ${{ secrets.OVH_APPLICATION_SECRET }}
OVH_CONSUMER_KEY: ${{ secrets.OVH_CONSUMER_KEY }}
OVH_CLOUD_PROJECT_SERVICE: ${{ secrets.OVH_CLOUD_PROJECT_SERVICE }}

- run: sudo chmod -R 777 /home/runner/_work/${{ github.event.repository.name }}

0 comments on commit 5788520

Please sign in to comment.