Update Terraform Beta Formula #2
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: Update Terraform Beta Formula | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Runs daily at midnight | |
workflow_dispatch: # Allows manual triggering of the workflow | |
jobs: | |
update-formula: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.3' # Specify the Ruby version you need | |
- name: Install dependencies | |
run: | | |
gem install nokogiri | |
- name: Run update script | |
run: ruby update_terraform-latest-beta.rb | |
- name: Read latest beta version | |
id: read_version | |
run: echo "LATEST_BETA_VERSION=$(cat terraform_latest_beta_version.txt)" >> $GITHUB_ENV | |
- name: Commit and push changes | |
run: | | |
git config --global user.name 'yakdriverbot' | |
git config --global user.email 'f1formula.juan@gmail.com' | |
git add Formula/terraform-latest-beta.rb | |
git commit -m "Update Terraform beta formula to version ${{ env.LATEST_BETA_VERSION }}" | |
git push | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
commit-message: "Update Terraform beta formula to version ${{ env.LATEST_BETA_VERSION }}" | |
branch: update-terraform-beta-formula | |
title: "Update Terraform beta formula to version ${{ env.LATEST_BETA_VERSION }}" | |
body: "This PR updates the Terraform beta formula to version ${{ env.LATEST_BETA_VERSION }} with the latest sha256 hashes." |