-
Notifications
You must be signed in to change notification settings - Fork 915
Open
Labels
Status: TriageThis is being looked at and prioritizedThis is being looked at and prioritizedType: BugSomething isn't working as documentedSomething isn't working as documented
Description
Expected Behavior
- I modify a ruleset, terraform apply fails due to the required workflow being in a repo with action sharing disabled.
- I fix the action sharing setting.
- Another apply sets the correct ruleset.
Actual Behavior
- I modify a ruleset, terraform apply fails due to the required workflow being in a repo with action sharing disabled. 422 Validation Failed [{Resource: Field: Code: Message:Invalid rule 'workflows': Invalid parameter workflows: Workflow error at index 0: Workflow source repository 'my-org/required-scan' has actions sharing disabled}]
- I fix the action sharing setting.
- Apply/plan says there is nothing to change. TF state command shows my changes, but when I actually look in org settings, the ruleset has not been updated.
I think there are two things going on:
- A bug somewhere that causes the state to be updated despite the 422 validation failure. The state gets updated with the changes, but the etag is from the old version of the rule since the update failed.
- Since the etag matches the old version of the rule, the provider sends it to GitHub when refreshing state and is told nothing is changed. Terraform provider has incorrect state, but since "nothing changed" it assumes that its internal state is accurate.
Terraform Version
Terraform Version:
v1.7.1
GitHub provider:
- Bad state created in v6.7.9
- Updated to v6.9.1 and it didn't help recover
Affected Resource(s)
- resource_github_organization_ruleset
Terraform Configuration Files
Steps to Reproduce
- Have an existing github org ruleset with no required workflow action (in evaluate)
- Update tf config to add a required workflow from a repo that doesn't have action sharing enabled. Also switch to active
terraform apply: Fails with
Error: PUT https://(gh instance)/api/v3/orgs/my-org/rulesets/108: 422 Validation Failed [{Resource: Field: Code: Message:Invalid rule 'workflows': Invalid parameter workflows: Workflow error at index 0: Workflow source repository 'my-org/required-scan' has actions sharing disabled}]
- Enable action sharing on the repo
- Re-apply workflow rule
Debug Output
Panic Output
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
Status: TriageThis is being looked at and prioritizedThis is being looked at and prioritizedType: BugSomething isn't working as documentedSomething isn't working as documented