Skip to content

trigger-workflow

trigger-workflow #54

name: Generate blueprints
on:
repository_dispatch:
types: [trigger-workflow]
workflow_dispatch:
jobs:
generate-blueprint:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Checkout terraform-aws-rds
uses: actions/checkout@v4
with:
repository: dfds/terraform-aws-rds
path: ./aws-rds-postgresql/aws-modules-rds
ref: ${{ github.event.client_payload.release_tag }}
token: ${{ secrets.AUTH_TOKEN }}
- name: Build docker image
working-directory: ./tools
run: |
docker build -t scaffold:latest .
shell: bash
- name: Run script
run: |
input=$(pwd)/aws-rds-postgresql/aws-modules-rds/
output=$(pwd)/aws-rds-postgresql/generic/
if [ -d $output ]; then
rm -rf $output
fi
mkdir -p $output
docker run -e RELEASE=${{ github.event.client_payload.release_tag }} -v $input:/input -v $output:/output scaffold:latest
sudo chown -R $USER:$USER $output
shell: bash
- name: setup git config
run: |
# setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Create a pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Github Actions update blueprints for RDS module"
title: "Github Actions update blueprints for RDS module"
body: |
Updates generated by the GitHub Actions workflow.
branch: blueprint-updates
base: main
labels: blueprints