Skip to content

Error loading yaml: prefapp/action-deployment-dispatch@v3 #25

@tonirvega

Description

@tonirvega

Context

Given this workflow and build-images.yml.

build_and_dispatch.yaml

name: Image build workflow

on:
  release:
    types: [ released ]

env:
  registry_url: xxxxxxxxxxxx.dkr.ecr.eu-west-1.amazonaws.com
  repository_name: service/config-server
  repo_state_name: state

jobs:
  calculate_matrix:
    runs-on: ubuntu-latest
    outputs:
      matrix: ${{ steps.calculate_matrix.outputs.matrix }}
    steps:
      - uses: actions/checkout@v3

      - name: calculate_matrix
        id: calculate_matrix
        uses: prefapp/action-flavour-images-matrix-generator@v1
        with:
          repository: ${{ env.registry_url }}/${{ env.repository_name }}

  build-image:
    runs-on: ubuntu-latest
    needs:
      - "calculate_matrix"
    strategy:
      matrix: ${{fromJson(needs.calculate_matrix.outputs.matrix)}}
    steps:
      - run: |
          echo ${{ matrix.tags}}
          echo ${{ matrix.build_args}}
          echo ${{ matrix.dockerfile}}

      - uses: actions/checkout@v3

      - name: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.ECR_AKI }}
          aws-secret-access-key: ${{ secrets.ECR_SAK }}
          aws-region: eu-west-1

      - name: Login to Amazon ECR
        id: login-ecr
        uses: aws-actions/amazon-ecr-login@v1

      - name: Build and push
        uses: docker/build-push-action@v3
        with:
          context: .
          build-args: ${{ matrix.build_args }}
          file: ${{ matrix.dockerfile }}
          tags: ${{ matrix.tags }}
          push: true

  make-dispatches:
    needs: build-image
    runs-on: ubuntu-latest
    steps:
      - name: Set env
        run: echo "state_repo=$GITHUB_REPOSITORY_OWNER/$repo_state_name" >> $GITHUB_ENV

      - uses: actions/checkout@v3

      - name: Dispatch changes
        uses: prefapp/action-deployment-dispatch@v3
        with:
          state_repo: ${{ env.repo_state_name }}
          image_repository: ${{ env.registry_url }}/${{ env.repository_name }}
          token: ${{ secrets.PAT_DEPLOY }}

build-images.yml

gradhoc:
  triggers:
    push:
      branches: [ "main" ]
    prerelease:
    release:
  dockerfile: Dockerfile
  build_args:
    SHA: "${{env.GITHUB_SHA}}"

Behavior

Error log:

Run prefapp/action-deployment-dispatch@v3

[14](https://github.com/Gradhoc/infra-config-server/actions/runs/3531354077/jobs/5924440518#step:4:15)---

[15](https://github.com/Gradhoc/infra-config-server/actions/runs/3531354077/jobs/5924440518#step:4:16)gradhoc:

[16](https://github.com/Gradhoc/infra-config-server/actions/runs/3531354077/jobs/5924440518#step:4:17)  config-server:

[17](https://github.com/Gradhoc/infra-config-server/actions/runs/3531354077/jobs/5924440518#step:4:18)    pro:

[18](https://github.com/Gradhoc/infra-config-server/actions/runs/3531354077/jobs/5924440518#step:4:19)      service_names:

[19](https://github.com/Gradhoc/infra-config-server/actions/runs/3531354077/jobs/5924440518#step:4:20)        - webService

[20](https://github.com/Gradhoc/infra-config-server/actions/runs/3531354077/jobs/5924440518#step:4:21)      version: last_release

[21](https://github.com/Gradhoc/infra-config-server/actions/runs/3531354077/jobs/5924440518#step:4:22)      flavour: gradhoc

[22](https://github.com/Gradhoc/infra-config-server/actions/runs/3531354077/jobs/5924440518#step:4:23)(node:1654) UnhandledPromiseRejectionWarning: Error loading yaml: instance.gradhoc.config-server.pro is not of a type(s) array

[23](https://github.com/Gradhoc/infra-config-server/actions/runs/3531354077/jobs/5924440518#step:4:24)(node:1654) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

[24](https://github.com/Gradhoc/infra-config-server/actions/runs/3531354077/jobs/5924440518#step:4:25)(node:1654) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

The developer switched to the prefapp/action-deployment-dispatch@v2 and the action runs without problems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions