While parsing a block mapping, did not find expected key. Failed to load github composite action.yml

182 Views Asked by At

Below is my caller action yml [Github Actions workflow] that gives error upon calling composite action:

---

name: RECYCLE_dev

  workflow_dispatch:

    inputs:

      ENVIRONMENT:
        type: choice

        options:
          - dev
          - qa
          - citest
          - cso
          - prod 

jobs:

  SEND_NOTIFICATION:

    runs-on: 'windows-latest'

    steps:

      - name: Send email notification
        uses: mybank/betech/emailnotification@mm365

        with:
          envName: "${{ inputs.ENVIRONMENT }}"
          EmailList: "[email protected]"
          comments: "These comments are passed to composite actions"

      

Below is my composite actions file:

---

name: Send Email Notification
description: Use this composite action to send out email notifications

inputs:

  envName:

    required: true
    type: string
    default: ''

  EmailList:

    required: true
    type: string
    default: '[email protected]'

  commitPath:

    required: false
    type: string
    default: ''

  comments:

    required: true
    type: string
    default: 'default Test'
    

runs:

  using: composite

  steps:

    - name: Trigger Email Notification

      run: |
           set-location "${{ github.workspace }}\betech\scripts"
           Write-host ./ApprovalActions.ps1 -sEnv "${{inputs.envName}}" -sApprovers ${{ inputs.EmailList }} -sAccordingToEnvironment $sAccordingToEnvironment
           ./ApprovalActions.ps1 -sEnv "${{inputs.envName}}" -sApprovers ${{ inputs.EmailList }} -sAccordingToEnvironment '"Recycle completed for "${{inputs.envName}}" environment"'       

I get the below error when running the composite action:

Error: mmctech\betech\mm365\emailnotification\action.yml:
Error: mmctech\betech\mm365\emailnotification\action.yml: (Line: 40, Col: 12, Idx: 992) - (Line: 41, Col: 190, Idx: 1327): While parsing a block mapping, did not find expected key.
Error: System.ArgumentException: Unexpected type '' encountered while reading 'action manifest root'. The type 'MappingToken' was expected.
   at GitHub.DistributedTask.ObjectTemplating.Tokens.TemplateTokenExtensions.AssertMapping(TemplateToken value, String objectDescription)
   at GitHub.Runner.Worker.ActionManifestManager.Load(IExecutionContext executionContext, String manifestFile)
Error: Fail to load mmctech\betech\mm365\emailnotification\action.yml

Can you please suggest what could be the issue with the yml file?

On side note would like to know if it is possible to call composite action in a file which is not named action.yml.

0

There are 0 best solutions below