Skip to content

Commit

Permalink
chore: remove more unnecessary workflows for deprecated providers
Browse files Browse the repository at this point in the history
  • Loading branch information
xiehan committed Dec 14, 2023
1 parent d1713ed commit 20c3853
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 294 deletions.
19 changes: 11 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ export class CdktfProviderProject extends cdk.JsiiProject {
devDeps: [
"@actions/core@^1.1.0",
"dot-prop@^5.2.0",
"semver@^7.5.3", // used by src/scripts/check-for-upgrades.ts
...(options.devDeps ?? []),
],
name: packageInfo.npm.name,
Expand All @@ -253,6 +252,7 @@ export class CdktfProviderProject extends cdk.JsiiProject {
repository: `https://github.com/${repository}.git`,
mergify: false,
eslint: false,
depsUpgrade: !isDeprecated,
depsUpgradeOptions: {
workflowOptions: {
labels: ["automerge", "auto-approve", "dependencies"],
Expand Down Expand Up @@ -323,9 +323,12 @@ export class CdktfProviderProject extends cdk.JsiiProject {
0,
setSafeDirectory
);
const { upgrade, pr } = (this.upgradeWorkflow as any).workflows[0].jobs;
upgrade.steps.splice(1, 0, setSafeDirectory);
pr.steps.splice(1, 0, setSafeDirectory);

if (!isDeprecated) {
const { upgrade, pr } = (this.upgradeWorkflow as any).workflows[0].jobs;
upgrade.steps.splice(1, 0, setSafeDirectory);
pr.steps.splice(1, 0, setSafeDirectory);
}

// Fix maven issue (https://github.com/cdklabs/publib/pull/777)
github.GitHub.of(this)?.tryFindWorkflow("release")?.file?.patch(
Expand Down Expand Up @@ -359,11 +362,11 @@ export class CdktfProviderProject extends cdk.JsiiProject {
new Automerge(this);
new LockIssues(this);

const upgradeScript = new CheckForUpgradesScriptFile(this, {
providerVersion,
fqproviderName,
});
if (!isDeprecated) {
const upgradeScript = new CheckForUpgradesScriptFile(this, {
providerVersion,
fqproviderName,
});
new ProviderUpgrade(this, {
checkForUpgradesScriptPath: upgradeScript.path,
workflowRunsOn,
Expand Down
2 changes: 2 additions & 0 deletions src/scripts/check-for-upgrades.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export class CheckForUpgradesScriptFile extends FileBase {
) {
super(project, "scripts/check-for-upgrades.js", options);
this.options = options;

project.addDevDeps("semver@^7.5.3");
}

protected synthesizeContent(resolver: IResolver): string | undefined {
Expand Down
Loading

0 comments on commit 20c3853

Please sign in to comment.