5
0

More than 3 years have passed since last update.

CircleCi expected type: String, found: Mapping エラー workflow でハマったときの対処方法

Last updated at Posted at 2020-07-15

circleci の設定で4時間溶かしたので供養。

エラー内容

Error: ERROR IN CONFIG FILE:
[#/workflows/dev_workflow] only 1 subschema matches out of 2
1. [#/workflows/dev_workflow/jobs/1] 0 subschemas matched instead of one
|   1. [#/workflows/dev_workflow/jobs/1] expected type: String, found: Mapping
|   |   SCHEMA:
|   |     type: string
|   |   INPUT:
|   |     e2e: null
|   |     requires:
|   |     - build_front
|   2. [#/workflows/dev_workflow/jobs/1/requires] expected type: Mapping, found: Sequence
|   |   SCHEMA:
|   |     type: object
|   |   INPUT:
|   |     - build_front

対処方法

job名の後のインデントは 2タブ(4スペース)
解決のヒントになったのは yaml to json でJSONの形が想定の値になっているか確認することができます。
頭の中で想定した構造と実際のオブジェクト構造の差分で問題が解消しました。

version: 2.1
jobs:
  # 割愛
workflows:
  version: 2
  dev_workflow:
    jobs:
      - build_front
      - e2e:
          requires: # ← ここのインデントはジョブ名に2回インデント(4スペース)
            - build_front

    # - e2e: # error case
    #   requires:
    #     - build_front

5
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
0