Search code examples
aws-codepipeline

CodePipeline - Pass commit message from Source Action to Approval Action


In AWS Codepipeline - Is there a way to pass info related to the trigger (ex: Commit Message content) from the Source Action to the "CustomData" field of the Manual Approval action ? Note: NotificationArn points to a Topic which has a Email subscription to Approve/Reject.


Solution

  • Yes it is possible.

    In the Source action, define the namespace:

    "name": "Source",
        "actions": [
          {
            "name": "Source",
            "actionTypeId": {
              "category": "Source",
              "owner": "AWS",
              "provider": "CodeCommit",
              "version": "1"
            },
            "namespace": "SourceVariables"
    

    In the approval action, use the variable:

    "name": "Approve",
    "actionTypeId": {
      "category": "Approval",
      "owner": "AWS",
      "provider": "Manual",
      "version": "1"
    },
    "configuration": {
      "CustomData": "Manual approval required. Message from Source is #{SourceVariables.CommitMessage}."