From bb1e6047d478332824c04fb0998eb145e49407e7 Mon Sep 17 00:00:00 2001 From: galargh Date: Sun, 20 Apr 2025 21:38:24 +0000 Subject: [PATCH] upgrade@14563545106 --- .github/dependabot.yml | 10 ++++++++++ CHANGELOG.md | 1 + .../src/resources/repository-branch-protection-rule.ts | 5 ++++- scripts/src/resources/repository-team.ts | 5 ++++- scripts/src/resources/team-member.ts | 6 +++++- 5 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..624d0f6 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + - package-ecosystem: "npm" + directory: "/scripts/" + schedule: + interval: "weekly" diff --git a/CHANGELOG.md b/CHANGELOG.md index 65d9032..9ad4692 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - updated upload and download artifacts actions to v4 ### Fixed +- always assert state type when creating resources from state - do not break long file content lines - source TF_WORKING_DIR from env helper instead of process.env in locals helper - fixed how terraform state is accessed before it the initial synchronization diff --git a/scripts/src/resources/repository-branch-protection-rule.ts b/scripts/src/resources/repository-branch-protection-rule.ts index 36c7be4..d2472e7 100644 --- a/scripts/src/resources/repository-branch-protection-rule.ts +++ b/scripts/src/resources/repository-branch-protection-rule.ts @@ -51,7 +51,10 @@ export class RepositoryBranchProtectionRule implements Resource { ) { const repositoryIndex: string = resource.index.split(':')[0] const repository = state.values.root_module.resources.find( - r => resource.mode === 'managed' && r.index === repositoryIndex + r => + r.mode === 'managed' && + r.type === Repository.StateType && + r.index === repositoryIndex ) const required_pull_request_reviews = resource.values.required_pull_request_reviews?.at(0) diff --git a/scripts/src/resources/repository-team.ts b/scripts/src/resources/repository-team.ts index dbf5819..29e8535 100644 --- a/scripts/src/resources/repository-team.ts +++ b/scripts/src/resources/repository-team.ts @@ -42,7 +42,10 @@ export class RepositoryTeam extends String implements Resource { ) { const teamIndex = resource.index.split(`:`).slice(0, -1).join(`:`) const team = state.values.root_module.resources.find( - r => resource.mode === 'managed' && r.index === teamIndex + r => + r.mode === 'managed' && + r.type === Team.StateType && + r.index === teamIndex ) teams.push( new RepositoryTeam( diff --git a/scripts/src/resources/team-member.ts b/scripts/src/resources/team-member.ts index 4a82844..11cbff3 100644 --- a/scripts/src/resources/team-member.ts +++ b/scripts/src/resources/team-member.ts @@ -56,8 +56,12 @@ export class TeamMember extends String implements Resource { ) { const teamIndex = resource.index.split(`:`).slice(0, -1).join(`:`) const team = state.values.root_module.resources.find( - r => resource.mode === 'managed' && r.index === teamIndex + r => + r.mode === 'managed' && + r.type === Team.StateType && + r.index === teamIndex ) + console.log(teamIndex, team) members.push( new TeamMember( team !== undefined && team.type === Team.StateType