Commit cfee7c5
committed
fix: add validation to key_prefix in autolink reference resource (#3176)
GitHub's API enforces that key_prefix:
- must only contain letters, numbers, or .-_+=:/#
- must not end with a number
Without client-side validation, terraform plan succeeds with an invalid
key_prefix (e.g. 'PTFY25') but terraform apply fails with a 422 from
the GitHub API, giving a confusing plan/apply inconsistency.
Added ValidateDiagFunc using a regexp that mirrors the API constraints,
so invalid key_prefix values are caught at plan time.1 parent e57f353 commit cfee7c5
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
| |||
0 commit comments