POL-1362 Flexera Policy CloudFormation Template Automation (#2651) #1
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 Meta Parent Policy Templates | |
on: | |
# Trigger this workflow on pushes to master | |
push: | |
branches: | |
- master | |
# Workflow dispatch trigger allows manually running workflow | |
workflow_dispatch: | |
branches: | |
- master | |
jobs: | |
meta-parent-policy-templates: | |
name: "Generate AWS CloudFormation Template" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Speed up checkout by not fetching history | |
- uses: ruby/setup-ruby@v1 | |
- name: Generate AWS CloudFormation Template | |
working-directory: tools/cloudformation-template | |
run: | | |
ruby aws_cft_generator.rb | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
commit-message: "Update AWS CloudFormation Template" | |
title: "Update AWS CloudFormation Template" | |
body: "Update AWS CloudFormation Template from GitHub Actions Workflow [${{ github.workflow }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" | |
branch: "task/update-aws-cloudformation-template" | |
delete-branch: true | |
labels: "automation" | |
- name: Check outputs | |
if: ${{ steps.cpr.outputs.pull-request-number }} | |
run: | | |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | |
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |