Generate blueprints #46
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: 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 | |
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 "<>" | |
# Updated section with branch creation and PR creation step | |
- name: Create a new branch for updates | |
run: | | |
git checkout -b blueprint-updates | |
- name: Commit updates to the new branch | |
run: | | |
git add $(pwd)/aws-rds-postgresql/generic/ | |
git commit -m "update blueprints for RDS module" | |
- 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 | |