File tree Expand file tree Collapse file tree 4 files changed +14
-3
lines changed Expand file tree Collapse file tree 4 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
49
49
- updated upload and download artifacts actions to v4
50
50
51
51
### Fixed
52
+ - always assert state type when creating resources from state
52
53
- do not break long file content lines
53
54
- source TF_WORKING_DIR from env helper instead of process.env in locals helper
54
55
- fixed how terraform state is accessed before it the initial synchronization
Original file line number Diff line number Diff line change @@ -51,7 +51,10 @@ export class RepositoryBranchProtectionRule implements Resource {
51
51
) {
52
52
const repositoryIndex : string = resource . index . split ( ':' ) [ 0 ]
53
53
const repository = state . values . root_module . resources . find (
54
- r => resource . mode === 'managed' && r . index === repositoryIndex
54
+ r =>
55
+ r . mode === 'managed' &&
56
+ r . type === Repository . StateType &&
57
+ r . index === repositoryIndex
55
58
)
56
59
const required_pull_request_reviews =
57
60
resource . values . required_pull_request_reviews ?. at ( 0 )
Original file line number Diff line number Diff line change @@ -42,7 +42,10 @@ export class RepositoryTeam extends String implements Resource {
42
42
) {
43
43
const teamIndex = resource . index . split ( `:` ) . slice ( 0 , - 1 ) . join ( `:` )
44
44
const team = state . values . root_module . resources . find (
45
- r => resource . mode === 'managed' && r . index === teamIndex
45
+ r =>
46
+ r . mode === 'managed' &&
47
+ r . type === Team . StateType &&
48
+ r . index === teamIndex
46
49
)
47
50
teams . push (
48
51
new RepositoryTeam (
Original file line number Diff line number Diff line change @@ -56,8 +56,12 @@ export class TeamMember extends String implements Resource {
56
56
) {
57
57
const teamIndex = resource . index . split ( `:` ) . slice ( 0 , - 1 ) . join ( `:` )
58
58
const team = state . values . root_module . resources . find (
59
- r => resource . mode === 'managed' && r . index === teamIndex
59
+ r =>
60
+ r . mode === 'managed' &&
61
+ r . type === Team . StateType &&
62
+ r . index === teamIndex
60
63
)
64
+ console . log ( teamIndex , team )
61
65
members . push (
62
66
new TeamMember (
63
67
team !== undefined && team . type === Team . StateType
You can’t perform that action at this time.
0 commit comments