From 389efb019709214f894eae9b5955d0c36f771f3a Mon Sep 17 00:00:00 2001 From: Erin Millard Date: Fri, 11 Oct 2024 09:04:18 +1000 Subject: [PATCH] Stop managing workflows --- dot-github/workflows/ci-scheduled.yml | 14 ---- dot-github/workflows/ci.yml | 12 ---- .../workflows/publish-release-manual.yml | 30 -------- dot-github/workflows/publish-release.yml | 27 ------- modules/repo/variables.tf | 12 ---- modules/repo/workflows.tf | 71 ------------------- repos-action.tf | 2 - repos-template.tf | 1 - repos-unique.tf | 7 +- 9 files changed, 1 insertion(+), 175 deletions(-) delete mode 100644 dot-github/workflows/ci-scheduled.yml delete mode 100644 dot-github/workflows/ci.yml delete mode 100644 dot-github/workflows/publish-release-manual.yml delete mode 100644 dot-github/workflows/publish-release.yml delete mode 100644 modules/repo/workflows.tf diff --git a/dot-github/workflows/ci-scheduled.yml b/dot-github/workflows/ci-scheduled.yml deleted file mode 100644 index abc9415..0000000 --- a/dot-github/workflows/ci-scheduled.yml +++ /dev/null @@ -1,14 +0,0 @@ -# DO NOT EDIT - This file is managed by ${ org }/repos. -name: CI (scheduled) - -on: - schedule: - - cron: 0 14 * * 0 # Sunday 2PM UTC = Monday 12AM AEST - -jobs: - ci: - name: ${ org_name } - uses: ${ org }/repos/.github/workflows/shared-ci-${ ci_type }.yml@main - secrets: inherit - with: - isScheduled: true diff --git a/dot-github/workflows/ci.yml b/dot-github/workflows/ci.yml deleted file mode 100644 index 5892564..0000000 --- a/dot-github/workflows/ci.yml +++ /dev/null @@ -1,12 +0,0 @@ -# DO NOT EDIT - This file is managed by ${ org }/repos. -name: CI - -on: - push: - pull_request: - -jobs: - ci: - name: ${ org_name } - uses: ${ org }/repos/.github/workflows/shared-ci-${ ci_type }.yml@main - secrets: inherit diff --git a/dot-github/workflows/publish-release-manual.yml b/dot-github/workflows/publish-release-manual.yml deleted file mode 100644 index 3c9089b..0000000 --- a/dot-github/workflows/publish-release-manual.yml +++ /dev/null @@ -1,30 +0,0 @@ -# DO NOT EDIT - This file is managed by ${ org }/repos. -name: Publish release (manual) - -on: - workflow_dispatch: - inputs: - tag: - description: The tag to publish - type: string - required: true - -jobs: - publish: - name: ${ org_name } - uses: ${ org }/repos/.github/workflows/shared-publish-release.yml@main - secrets: inherit - permissions: - contents: write - discussions: write - with: -%{ if discussion_category != "" ~} - discussionCategory: ${ discussion_category } -%{ endif ~} -%{ if make_target != "" ~} - makeTarget: ${ make_target } -%{ endif ~} -%{ if use_release_action_main ~} - useReleaseActionMain: true -%{ endif ~} - tag: ${"$"}{{ inputs.tag }} diff --git a/dot-github/workflows/publish-release.yml b/dot-github/workflows/publish-release.yml deleted file mode 100644 index d8d2b34..0000000 --- a/dot-github/workflows/publish-release.yml +++ /dev/null @@ -1,27 +0,0 @@ -# DO NOT EDIT - This file is managed by ${ org }/repos. -name: Publish release - -on: - push: - tags: - - "*" - -jobs: - publish: - name: ${ org_name } - uses: ${ org }/repos/.github/workflows/shared-publish-release.yml@main - secrets: inherit - permissions: - contents: write - discussions: write - with: -%{ if discussion_category != "" ~} - discussionCategory: ${ discussion_category } -%{ endif ~} -%{ if make_target != "" ~} - makeTarget: ${ make_target } -%{ endif ~} -%{ if use_release_action_main ~} - useReleaseActionMain: true -%{ endif ~} - tag: ${"$"}{{ github.ref_name }} diff --git a/modules/repo/variables.tf b/modules/repo/variables.tf index ced4717..10d618e 100644 --- a/modules/repo/variables.tf +++ b/modules/repo/variables.tf @@ -42,18 +42,6 @@ variable "pages_branch" { default = null } -variable "ci_workflows" { - description = "The GitHub Actions CI workflows to use" - type = list(string) - default = [] -} - -variable "has_publish_release_workflow" { - description = "Whether to add a basic GitHub Actions release publishing workflow" - type = bool - default = true -} - variable "manage_renovate" { description = "Whether to manage the Renovate configuration" type = bool diff --git a/modules/repo/workflows.tf b/modules/repo/workflows.tf deleted file mode 100644 index 2f68b78..0000000 --- a/modules/repo/workflows.tf +++ /dev/null @@ -1,71 +0,0 @@ -resource "github_repository_file" "dot_github_workflows_ci_yml" { - for_each = toset(var.ci_workflows) - - commit_author = module.constants.committer.name - commit_email = module.constants.committer.email - repository = github_repository.this.name - file = ".github/workflows/ci-${each.value}.yml" - commit_message = "Update \"CI\" GHA workflow" - overwrite_on_create = true - - content = templatefile("dot-github/workflows/ci.yml", { - ci_type = each.value - org = module.constants.org - org_name = module.constants.org_name - }) -} - -resource "github_repository_file" "dot_github_workflows_ci_scheduled_yml" { - for_each = toset(var.ci_workflows) - - commit_author = module.constants.committer.name - commit_email = module.constants.committer.email - repository = github_repository.this.name - file = ".github/workflows/ci-${each.value}-scheduled.yml" - commit_message = "Update \"CI (scheduled)\" GHA workflow" - overwrite_on_create = true - - content = templatefile("dot-github/workflows/ci-scheduled.yml", { - ci_type = each.value - org = module.constants.org - org_name = module.constants.org_name - }) -} - -resource "github_repository_file" "dot_github_workflows_publish_release_yml" { - for_each = toset(var.has_publish_release_workflow ? ["basic"] : []) - - commit_author = module.constants.committer.name - commit_email = module.constants.committer.email - repository = github_repository.this.name - file = ".github/workflows/publish-release.yml" - commit_message = "Update \"Publish release\" GHA workflow" - overwrite_on_create = true - - content = templatefile("dot-github/workflows/publish-release.yml", { - discussion_category = var.has_release_discussions ? "Releases" : "" - make_target = var.release_make_target == null ? "" : var.release_make_target - org = module.constants.org - org_name = module.constants.org_name - use_release_action_main = var.use_release_action_main - }) -} - -resource "github_repository_file" "dot_github_workflows_publish_release_manual_yml" { - for_each = toset(var.has_publish_release_workflow ? ["basic"] : []) - - commit_author = module.constants.committer.name - commit_email = module.constants.committer.email - repository = github_repository.this.name - file = ".github/workflows/publish-release-manual.yml" - commit_message = "Update \"Publish release (manual)\" GHA workflow" - overwrite_on_create = true - - content = templatefile("dot-github/workflows/publish-release-manual.yml", { - discussion_category = var.has_release_discussions ? "Releases" : "" - make_target = var.release_make_target == null ? "" : var.release_make_target - org = module.constants.org - org_name = module.constants.org_name - use_release_action_main = var.use_release_action_main - }) -} diff --git a/repos-action.tf b/repos-action.tf index cf246cd..ce74e61 100644 --- a/repos-action.tf +++ b/repos-action.tf @@ -14,7 +14,6 @@ module "repo_github_release_from_tag" { pages_branch = "gh-pages" - ci_workflows = ["action"] use_release_action_main = true renovate_post_upgrade_command = "make regenerate" @@ -40,6 +39,5 @@ module "repo_provision_github_tokens" { pages_branch = "gh-pages" - ci_workflows = ["action"] renovate_post_upgrade_command = "make regenerate" } diff --git a/repos-template.tf b/repos-template.tf index 025c084..e44078b 100644 --- a/repos-template.tf +++ b/repos-template.tf @@ -3,7 +3,6 @@ module "repo_action_template" { name = "action-template" description = "A template repo for creating GitHub Actions" - ci_workflows = ["action"] renovate_post_upgrade_command = "make regenerate" is_template = true diff --git a/repos-unique.tf b/repos-unique.tf index 97814bb..de5a947 100644 --- a/repos-unique.tf +++ b/repos-unique.tf @@ -5,8 +5,6 @@ module "repo_branding" { homepage_url = "https://ghalactic.github.io/branding" pages_branch = "gh-pages" - - has_publish_release_workflow = false } module "repo_org_dot_github_dot_io" { @@ -16,8 +14,6 @@ module "repo_org_dot_github_dot_io" { homepage_url = "https://ghalactic.github.io" pages_branch = "main" - - has_publish_release_workflow = false } module "repo_renovate" { @@ -26,6 +22,5 @@ module "repo_renovate" { description = "Self-hosted Renovate for Ghalactic" homepage_url = "https://github.com/ghalactic/renovate/actions/workflows/renovate.yml" - has_publish_release_workflow = false - manage_renovate = false + manage_renovate = false }