Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Support use of output from synth step as input in later ShellSteps

オープン
#364 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
aws, github-actions, typescript
領域
ci-cd

調査の方向性

src/pipeline.ts の参照された行付近にあるアーティファクトのダウンロードロジックから始め、@aws-cdk/pipelines/lib/blueprint/shell-step.ts にある出力 FileSet の命名と比較します。提示された ShellStep の例から workflow を生成し、後続のステップで使用されるアーティファクト名が synth ステップによってアップロードされたアーティファクトと一致することを確認します。

索引モデルが issue の本文から書いたものです。

説明

I would expect this code to work:

    const pipeline = new GitHubWorkflow(app, 'Pipeline', {
      workflowPath: `${dir}/.github/workflows/deploy.yml`,
      synth: new ShellStep('Build', {
        installCommands: ['yarn'],
        commands: ['yarn build'],
      }),
      jobSettings: { if: 'check on Synthesize and Publish Assets' },
    });

    const stage = new Stage(app, 'MyStage', {
      env: { account: '111111111111', region: 'us-east-1' },
    });

    new Stack(stage, 'MyStack');


    pipeline.addStageWithGitHubOptions(stage, {
      pre: [
        new ShellStep('Extra-Shell-Step', {
          additionalInputs: {
            'cdk.out': pipeline.cloudAssemblyFileSet,
          },
          commands: ['ls -al cdk.out'],
        }),
      ],
    });

The resulting yaml file doesn't work, since the uploaded artifact is named "cdk.out" but the id used as the name from the pipeline.cloudAssemblyFileSet is `"Output":

      Build-Build:
        name: Synthesize
        if: check on Synthesize and Publish Assets
        permissions:
          contents: read
          id-token: none
        runs-on: ubuntu-latest
        needs: []
        env: {}
        steps:
          - name: Checkout
            uses: actions/checkout@v2
          - name: Install
            run: yarn
          - name: Build
            run: yarn build
          - name: Upload cdk.out
            uses: actions/[email protected]
            with:
              name: cdk.out # ← here ⚠️
              path: cdk.out

And later:

      MyStage-Extra-Shell-Step:
        name: Extra-Shell-Step
        if: check on Synthesize and Publish Assets
        permissions:
          contents: read
        runs-on: ubuntu-latest
        needs:
          - Build-Build
        env: {}
        steps:
          - uses: actions/download-artifact@v2
            with:
              name: Output  # ← here ⚠️
              path: cdk.out
          - run: ls -al cdk.out

The name Output is coming from @aws-cdk/pipelines/lib/blueprint/shell-step.ts:

    if (props.primaryOutputDirectory) {
      this._primaryOutputDirectory = props.primaryOutputDirectory;
      const fileSet = new FileSet('Output', this);  // ← here ⚠️
      this.configurePrimaryOutput(fileSet);
      this.outputs.push({ directory: props.primaryOutputDirectory, fileSet });
    }

Perhaps I'm wrong, but it appears that by using this.cloudAssemblyFileSet.id instead of CDKOUT_ARTIFACT here and here this would work as expected.

主要言語
TypeScript
スター
385
フォーク
45
平均マージ
1日 52分
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cdklabs/cdk-pipelines-github のほかの issue

cdklabs/cdk-pipelines-github の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。