@codedrifters/configulator 0.0.323 → 0.0.324

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.mts CHANGED
@@ -11082,6 +11082,13 @@ declare class AwsDeployWorkflow extends Component {
11082
11082
  constructor(project: AwsCdkTypeScriptApp, options?: DeployWorkflowOptions);
11083
11083
  setupNode: () => Array<JobStep>;
11084
11084
  setupPnpm: () => Array<JobStep>;
11085
+ /**
11086
+ * Build the deterministic GitHub Actions job name for a deploy target.
11087
+ *
11088
+ * Used both to register the post-build job and as the sticky-PR-comment
11089
+ * header so dev/stage/prod comments don't collide on the same PR.
11090
+ */
11091
+ private buildJobName;
11085
11092
  /**
11086
11093
  * Builds a GitHub Actions condition string that checks if the current branch
11087
11094
  * matches any of the provided branch patterns.
package/lib/index.d.ts CHANGED
@@ -11131,6 +11131,13 @@ declare class AwsDeployWorkflow extends Component {
11131
11131
  constructor(project: AwsCdkTypeScriptApp, options?: DeployWorkflowOptions);
11132
11132
  setupNode: () => Array<JobStep>;
11133
11133
  setupPnpm: () => Array<JobStep>;
11134
+ /**
11135
+ * Build the deterministic GitHub Actions job name for a deploy target.
11136
+ *
11137
+ * Used both to register the post-build job and as the sticky-PR-comment
11138
+ * header so dev/stage/prod comments don't collide on the same PR.
11139
+ */
11140
+ private buildJobName;
11134
11141
  /**
11135
11142
  * Builds a GitHub Actions condition string that checks if the current branch
11136
11143
  * matches any of the provided branch patterns.
package/lib/index.js CHANGED
@@ -35607,6 +35607,22 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen25.Compone
35607
35607
  }
35608
35608
  ];
35609
35609
  };
35610
+ /**
35611
+ * Build the deterministic GitHub Actions job name for a deploy target.
35612
+ *
35613
+ * Used both to register the post-build job and as the sticky-PR-comment
35614
+ * header so dev/stage/prod comments don't collide on the same PR.
35615
+ */
35616
+ this.buildJobName = (target) => {
35617
+ return [
35618
+ target.awsStageType,
35619
+ target.deploymentTargetRole,
35620
+ "deploy",
35621
+ target.project.name,
35622
+ target.account,
35623
+ target.region
35624
+ ].join("-");
35625
+ };
35610
35626
  /**
35611
35627
  * Builds a GitHub Actions condition string that checks if the current branch
35612
35628
  * matches any of the provided branch patterns.
@@ -35646,6 +35662,7 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen25.Compone
35646
35662
  } = target;
35647
35663
  const { roleArn, stackPattern } = ciDeploymentConfig ?? {};
35648
35664
  const { rootCdkOut } = awsDeploymentConfig;
35665
+ const deployJobName = this.buildJobName(target);
35649
35666
  return [
35650
35667
  ...this.setupPnpm(),
35651
35668
  ...this.setupNode(),
@@ -35678,7 +35695,37 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen25.Compone
35678
35695
  ...awsDeploymentConfig.cdkCli.deployOptionsFor(target),
35679
35696
  app: rootCdkOut,
35680
35697
  stackPatterns: stackPattern ? [stackPattern] : void 0
35681
- })}`
35698
+ })} --outputs-file cdk-outputs.json`
35699
+ },
35700
+ /**
35701
+ * Render a job-summary table listing every `*Endpoint` output emitted
35702
+ * by the deploy. Also writes the same list to `deploy-urls.md` so the
35703
+ * follow-up sticky-PR-comment step can reuse it.
35704
+ */
35705
+ {
35706
+ name: "Render deploy summary",
35707
+ if: "hashFiles('cdk-outputs.json') != ''",
35708
+ shell: "bash",
35709
+ run: [
35710
+ 'echo "## Deployed endpoints" >> "$GITHUB_STEP_SUMMARY"',
35711
+ `jq -r '[.[] | to_entries[] | select(.key | test("Endpoint$")) | .value] | .[] | "- [\\(.)](\\(.))"' cdk-outputs.json | tee deploy-urls.md >> "$GITHUB_STEP_SUMMARY"`,
35712
+ 'echo "" >> "$GITHUB_STEP_SUMMARY"',
35713
+ 'echo "_DNS/CloudFront may take ~1 minute to propagate._" >> "$GITHUB_STEP_SUMMARY"'
35714
+ ].join("\n")
35715
+ },
35716
+ /**
35717
+ * Post a sticky PR comment listing each deployed endpoint. The
35718
+ * comment is keyed by the deploy job name so dev/stage/prod comments
35719
+ * don't collide on the same PR.
35720
+ */
35721
+ {
35722
+ name: "Sticky PR comment with deploy endpoints",
35723
+ if: "github.event_name == 'pull_request' && hashFiles('deploy-urls.md') != ''",
35724
+ uses: "marocchino/sticky-pull-request-comment@v2",
35725
+ with: {
35726
+ header: deployJobName,
35727
+ path: "deploy-urls.md"
35728
+ }
35682
35729
  }
35683
35730
  ];
35684
35731
  };
@@ -35773,18 +35820,8 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen25.Compone
35773
35820
  ...buildWorkflowOptions?.preBuildSteps ?? []
35774
35821
  ]
35775
35822
  });
35776
- const buildJobName = (target) => {
35777
- return [
35778
- target.awsStageType,
35779
- target.deploymentTargetRole,
35780
- "deploy",
35781
- target.project.name,
35782
- target.account,
35783
- target.region
35784
- ].join("-");
35785
- };
35786
35823
  this.awsDeploymentTargets.forEach((target) => {
35787
- const deployJobName = buildJobName(target);
35824
+ const deployJobName = this.buildJobName(target);
35788
35825
  const branchFilterCondition = this.buildBranchFilterCondition(
35789
35826
  target.branches
35790
35827
  );
@@ -35797,13 +35834,14 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen25.Compone
35797
35834
  needs: [
35798
35835
  "build",
35799
35836
  ...this.deployAfterTargets.map((p) => {
35800
- return buildJobName(p);
35837
+ return this.buildJobName(p);
35801
35838
  })
35802
35839
  ],
35803
35840
  runsOn: ["ubuntu-latest"],
35804
35841
  permissions: {
35805
35842
  contents: import_workflows_model5.JobPermission.READ,
35806
- idToken: import_workflows_model5.JobPermission.WRITE
35843
+ idToken: import_workflows_model5.JobPermission.WRITE,
35844
+ pullRequests: import_workflows_model5.JobPermission.WRITE
35807
35845
  },
35808
35846
  concurrency: deployJobName,
35809
35847
  if: jobCondition,