Skip to content

refactor(runner_group): selected_workflows set#3480

Open
sheeeng wants to merge 1 commit into
integrations:mainfrom
sheeeng:refactor/order-independent-selected-workflows-set
Open

refactor(runner_group): selected_workflows set#3480
sheeeng wants to merge 1 commit into
integrations:mainfrom
sheeeng:refactor/order-independent-selected-workflows-set

Conversation

@sheeeng

@sheeeng sheeeng commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Change selected_workflows from TypeList to TypeSet in both github_actions_runner_group and
github_enterprise_actions_runner_group resources. A TypeList is order-sensitive, causing Terraform to detect spurious drift when the GitHub API returns workflows in a different order than specified in configuration. A TypeSet compares elements regardless of order, eliminating the persistent plan diff.

Fix #3478.

Resolves #3478.


Before the change?

  • Consistent drift shown for selected_workflows.
  • selected_workflows in github_actions_runner_group and
    github_enterprise_actions_runner_group is defined as a TypeList,
    which is order-sensitive. When the GitHub API returns workflows in a
    different order than the Terraform configuration specifies, Terraform
    detects a spurious diff and plans an unnecessary update on every run.

After the change?

  • No changes should be shown as the set is identical, even though the list might be in different order.
  • selected_workflows is now a TypeSet, which compares elements
    regardless of order. The persistent plan drift is eliminated.
  • A SchemaVersion bump to 1 and StateUpgraders entry ensures
    existing state is migrated automatically on the next
    terraform plan or terraform apply.

Pull request checklist

  • Schema migrations have been created if needed (example)
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

What changed:* The selected_workflows attribute type changed from
TypeList to TypeSet. Per the [breaking changes policy][breaking],
this qualifies as "changing the type of a response model field or
parameter."

Impact: Users who reference individual selected_workflows elements
by index will need to update their configurations:

# Before, will no longer work when this PR is merged into default branch.
output "first_workflow" {
  value = github_actions_runner_group.example.selected_workflows[0]
}

# After this PR is merged into default branch.
output "first_workflow" {
  value = tolist(github_actions_runner_group.example.selected_workflows)[0]
}

Migration steps:

  1. Upgrade the provider to the new version.
  2. Run terraform plan. The state upgrader migrates existing state automatically; no manual intervention is required.
  3. If your configuration references selected_workflows by index, wrap the attribute in tolist(...) as shown above.
  4. Confirm no unexpected diffs appear in the plan output.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

👋 Hi, and thank you for this contribution!

This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can.

You can help us prioritize by joining the discussion on open issues and PRs, sharing details on the changes you need, and reviewing other contributions.


🤖 This is an automated message.

@sheeeng sheeeng changed the title fix(runner_group): use set for selected_workflows refactor(runner_group): selected_workflows set Jun 8, 2026
@sheeeng sheeeng force-pushed the refactor/order-independent-selected-workflows-set branch 2 times, most recently from c471768 to aefbde2 Compare June 8, 2026 10:10
@sheeeng sheeeng marked this pull request as ready for review June 8, 2026 10:20
Change `selected_workflows` from `TypeList` to `TypeSet` in both
`github_actions_runner_group` and
`github_enterprise_actions_runner_group` resources. A `TypeList` is
order-sensitive, causing Terraform to detect spurious drift when the
GitHub API returns workflows in a different order than specified in
configuration. A `TypeSet` compares elements regardless of order,
eliminating the persistent plan diff.

Fix integrations#3478.
@sheeeng sheeeng force-pushed the refactor/order-independent-selected-workflows-set branch from aefbde2 to eadd7e4 Compare June 8, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: github_actions_runner_group's selected_workflows consistent drift

1 participant