Skip to content

Add New Terraform Casks #1477

Add New Terraform Casks

Add New Terraform Casks #1477

Workflow file for this run

name: Add New Terraform Casks
on:
schedule:
# Daily at 04:20 UTC
- cron: '20 4 * * *'
workflow_dispatch: {}
jobs:
add_new_casks:
name: Add New Terraform Casks
# Only run on the main repo
if: github.repository == 'Yleisradio/homebrew-terraforms'
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Configure git
run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: Find and add new Casks
shell: bash
run: |
echo 'TF_VERSIONS<<EOF' >> $GITHUB_ENV
./scripts/add_new_terraform_casks | while read version path; do
echo "Adding v$version"
printf '* [v%s](https://github.com/hashicorp/terraform/releases/tag/v%s)\n' "$version" "$version" >> $GITHUB_ENV
git add "$path"
git commit -m "Add Terraform v$version"
done
echo 'EOF' >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
branch: new-terraform-versions
title: Add new Terraform versions
body: |
**Versions:**
${{ env.TF_VERSIONS }}
Generated by "${{ github.workflow }}" GitHub Action
delete-branch: true
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>