Skip to content

TFMesh

TFMesh #1205

name: TFMesh
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- master
schedule:
# runs the pipeline every hour on the hour
- cron: '0 */24 * * *'
jobs:
tfmesh:
runs-on: ubuntu-latest
name: "Automated Module Version Updates"
steps:
- name: Checkout Repo Content
uses: actions/checkout@v2
- name: Set Up Agent
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Run Python Script
id: tfmesh
run: |
pip install -r requirements.txt
pip install --editable .
output=$(tfmesh apply --no-color)
output="${output//'%'/'%25'}"
output="${output//$'\n'/'%0A'}"
output="${output//$'\r'/'%0D'}"
echo "::set-output name=changelog::$output"
env:
TFMESH_GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
TFMESH_TERRAFORM_FOLDER: terraform
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
commit-message: "Update Terraform module versions."
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
branch: module-version-updates
base: ${{ github.head_ref }}
delete-branch: true
title: 'Terraform module version updates'
labels: |
bot
body: |
Module versions were automatically updated based on the latest versions available.
```
${{ steps.tfmesh.outputs.changelog }}
```
add-paths: |
**/*.tf