Update Helm release argo-cd to v5.55.0 #30
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
--- | |
name: "aks" | |
env: | |
ARM_USE_OIDC: true | |
ARM_CLIENT_ID: e61bb1a2-a6c6-411d-b1a1-26a9e7e06945 | |
AZURE_CLIENT_ID: e61bb1a2-a6c6-411d-b1a1-26a9e7e06945 | |
AZURE_TENANT_ID: 9c1de352-64a4-4509-b3fc-4ef2df8db9b8 | |
AZURE_SUBSCRIPTION_ID: e1608e24-0728-4efd-ba5b-a05693b53c5a | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'aks/terraform/**' | |
# push: | |
# branches: | |
# - main | |
# paths: | |
# - 'aks/terraform/**' | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[ci skip]')" | |
environment: aks-terraform-${{ matrix.working-directory }} | |
concurrency: aks-terraform-${{ matrix.working-directory }} | |
strategy: | |
fail-fast: false | |
matrix: | |
working-directory: | |
# - cluster | |
- infrastructure | |
defaults: | |
run: | |
working-directory: aks/terraform/${{ matrix.working-directory }} | |
permissions: | |
pull-requests: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: hashicorp/setup-terraform@v2 | |
- name: 'Az CLI login' | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ env.AZURE_CLIENT_ID }} | |
tenant-id: ${{ env.AZURE_TENANT_ID }} | |
subscription-id: ${{ env.AZURE_SUBSCRIPTION_ID }} | |
- name: Terraform fmt | |
id: fmt | |
run: terraform fmt -check | |
continue-on-error: true | |
- name: Terraform Init | |
id: init | |
run: terraform init -lock=false | |
- name: Terraform Validate | |
id: validate | |
run: terraform validate | |
- name: Terraform Plan | |
id: plan | |
run: terraform plan -lock=false | |
continue-on-error: true | |
- uses: actions/github-script@v6 | |
if: github.event_name == 'pull_request' | |
env: | |
PLAN: "terraform\n${{ steps.plan.outputs.stdout }}" | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
// 1. Retrieve existing bot comments for the PR | |
const { data: comments } = await github.rest.issues.listComments({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
}) | |
const botComment = comments.find(comment => { | |
return comment.user.type === 'Bot' && comment.body.includes('Terraform Format and Style') | |
}) | |
// 2. Prepare format of the comment | |
const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\` | |
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\` | |
#### Terraform Validation 🤖\`${{ steps.validate.outcome }}\` | |
<details><summary>Validation Output</summary> | |
\`\`\`\n | |
${{ steps.validate.outputs.stdout }} | |
\`\`\` | |
</details> | |
#### Terraform Plan 📖\`${{ steps.plan.outcome }}\` | |
<details><summary>Show Plan</summary> | |
\`\`\`\n | |
${process.env.PLAN} | |
\`\`\` | |
</details> | |
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Working Directory: \`${{ env.tf_actions_working_dir }}\`, Workflow: \`${{ github.workflow }}\`*`; | |
// 3. If we have a comment, update it, otherwise create a new one | |
if (botComment) { | |
github.rest.issues.updateComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
comment_id: botComment.id, | |
body: output | |
}) | |
} else { | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: output | |
}) | |
} | |
- name: Terraform Plan | |
run: terraform plan -out tfplan.binary -lock=false | |
continue-on-error: true | |
- name: Terraform show | |
run: terraform show -json tfplan.binary > plan.json | |
continue-on-error: true | |
# Install the Infracost CLI, see https://github.com/infracost/actions/tree/master/setup | |
# for other inputs such as version, and pricing-api-endpoint (for self-hosted users). | |
- name: Setup Infracost | |
uses: infracost/actions/setup@v2 | |
with: | |
api-key: ${{ secrets.INFRACOST_API_KEY }} | |
# Generate Infracost JSON output, the following docs might be useful: | |
# Multi-project/workspaces: https://www.infracost.io/docs/features/config_file | |
# Combine Infracost JSON files: https://www.infracost.io/docs/features/cli_commands/#combined-output-formats | |
- name: Generate Infracost JSON | |
run: infracost diff --path plan.json --format json --out-file /tmp/infracost.json | |
working-directory: ${{ env.working-directory }} | |
# Env vars can be set using the usual GitHub Actions syntax | |
# See the list of supported Infracost env vars here: https://www.infracost.io/docs/integrations/environment_variables/ | |
# env: | |
# MY_ENV: ${{ secrets.MY_ENV }} | |
# See https://www.infracost.io/docs/features/cli_commands/#comment-on-pull-requests for other options. | |
- name: Post Infracost comment | |
if: github.event_name == 'pull_request' | |
run: | | |
# Posts a comment to the PR using the 'update' behavior. | |
# This creates a single comment and updates it. The "quietest" option. | |
# The other valid behaviors are: | |
# delete-and-new - Delete previous comments and create a new one. | |
# hide-and-new - Minimize previous comments and create a new one. | |
# new - Create a new cost estimate comment on every push. | |
infracost comment github --path /tmp/infracost.json \ | |
--repo ${{github.repository}} \ | |
--github-token ${{github.token}} \ | |
--pull-request ${{github.event.pull_request.number}} \ | |
--behavior update |