diff --git a/action.yml b/action.yml index 5e08ab5..79b0ee5 100644 --- a/action.yml +++ b/action.yml @@ -149,3 +149,24 @@ runs: 2. Merge this pull request. Once merged, Gruntwork Pipelines will `terragrunt apply` the baseline in the newly created AWS account(s). + + - name: "[ProvisionAccount]: Communicate PR URL" + shell: bash + if: ${{ steps.gruntwork_context.outputs.terragrunt_command == 'apply' }} + env: + ACTION_PATH: ${{ github.action_path }} + MERGED_PR_URL: https://github.com/${{ github.repository }}/pull/${{ steps.get_pr_number.outputs.pr_number }} + CREATED_PR_URL: ${{ steps.create_pr.outputs.pull-request-url }} + GH_TOKEN: ${{ inputs.INFRA_ROOT_WRITE_TOKEN }} + run: | + boilerplate \ + --template-url "$ACTION_PATH/templates/step-summary" \ + --output-folder "." \ + --var PullRequestURL="$CREATED_PR_URL" + + cat step-summary.md >> "$GITHUB_STEP_SUMMARY" + + gh pr comment "$MERGED_PR_URL" \ + -F step-summary.md + + rm -f step-summary.md diff --git a/templates/step-summary/boilerplate.yml b/templates/step-summary/boilerplate.yml new file mode 100644 index 0000000..ec2ab40 --- /dev/null +++ b/templates/step-summary/boilerplate.yml @@ -0,0 +1,4 @@ +variables: + - name: PullRequestURL + description: The URL for the pull request created as part of account creation + type: string diff --git a/templates/step-summary/step-summary.md b/templates/step-summary/step-summary.md new file mode 100644 index 0000000..22daae3 --- /dev/null +++ b/templates/step-summary/step-summary.md @@ -0,0 +1,7 @@ +### Baseline Pull Request 🚧 + +Account provisioning complete! 🎉 + +A baseline pull request has been created to provision the initial resources you need in a new account to have it ready for production workloads. + +To see the pull request, click [here]({{ .PullRequestURL }}).