diff --git a/action.yml b/action.yml index 5e08ab5..dd69601 100644 --- a/action.yml +++ b/action.yml @@ -149,3 +149,23 @@ 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_NUMBER: ${{ steps.get_pr_number.outputs.pr_number }} + CREATED_PR_URL: ${{ steps.create_pr.outputs.pull-request-url }} + 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_NUMBER" \ + -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..47ee978 --- /dev/null +++ b/templates/step-summary/step-summary.md @@ -0,0 +1,7 @@ +### Baseline Pull Request + +Now that you've created your account, you're ready to review and merge the baseline pull request. + +This is the pull request that contains the initial resources you need in a new account to have it ready for use. + +To see the pull request, click [here]({{ .PullRequestURL }}).