Skip to content

Commit

Permalink
Migrate github actions to shared workflows (#92)
Browse files Browse the repository at this point in the history
* Migrate github actions to shared workflows

* Apply suggestions from code review
  • Loading branch information
goruha authored May 21, 2024
1 parent a4ee807 commit 9f2a18b
Show file tree
Hide file tree
Showing 11 changed files with 130 additions and 21 deletions.
5 changes: 5 additions & 0 deletions migrate/migrations/20240518/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## what
- Update workflows (`.github/workflows/settings.yaml`) to use shared workflows from `.github` repo

## why
- Reduce nested levels of reusable workflows
14 changes: 14 additions & 0 deletions migrate/migrations/20240518/repos-00
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cloudposse/github-action-test-action
cloudposse/github-action-atmos-get-setting
cloudposse/github-action-pre-commit
cloudposse/github-action-config-levels
cloudposse/github-action-atmos-terraform-drift-detection
cloudposse/github-action-matrix-outputs-write
cloudposse/github-action-setup-atmos
cloudposse/github-action-docker-build-push
cloudposse/github-action-docker-image-exists
cloudposse/github-action-docker-promote
cloudposse/github-action-deploy-argocd
cloudposse/github-action-deploy-helmfile
cloudposse/github-action-auto-release
cloudposse/github-action-preview-environment-controller
15 changes: 15 additions & 0 deletions migrate/migrations/20240518/repos-01
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cloudposse/github-action-kubernetes-environment
cloudposse/github-action-yaml-config-query
cloudposse/github-action-run-ecspresso
cloudposse/github-action-jq
cloudposse/github-action-auto-format
cloudposse/github-action-sync-docker-repos
cloudposse/github-action-matrix-extended
cloudposse/github-action-atmos-terraform-select-components
cloudposse/github-action-atmos-terraform-apply
cloudposse/github-action-atmos-affected-trigger-spacelift
cloudposse/github-action-matrix-outputs-read
cloudposse/github-action-release-label-validator
cloudposse/github-action-atmos-terraform-plan
cloudposse/github-action-atmos-affected-stacks
cloudposse/github-action-atmos-terraform-drift-remediation
16 changes: 16 additions & 0 deletions migrate/migrations/20240518/repos-02
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cloudposse/github-action-release-branch-manager
cloudposse/github-action-major-release-tagger
cloudposse/github-action-validate-codeowners
cloudposse/github-action-terraform-auto-context
cloudposse/github-action-atmos-component-updater
cloudposse/github-action-deploy-ecspresso
cloudposse/github-action-wait-commit-status
cloudposse/github-action-secret-outputs
cloudposse/github-action-interface-environment
cloudposse/github-action-terratest
cloudposse/github-action-spacelift-stack-deploy
cloudposse/github-action-aws-region-reduction-map
cloudposse/github-action-docker-compose-test-run
cloudposse/github-action-seek-deployment
cloudposse/github-action-preview-labels-cleanup
cloudposse/github-action-monorepo-random-controller
5 changes: 5 additions & 0 deletions migrate/migrations/20240518/repos-03
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cloudposse/github-action-deploy-spacelift
cloudposse/github-action-telemetry
cloudposse/github-action-mega-linter
cloudposse/github-action-datadog-notify
cloudposse/github-action-pull-request-labeling
5 changes: 5 additions & 0 deletions migrate/migrations/20240518/repos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
gh repo list cloudposse --limit 500 --json name,owner \
--jq '.[] | select(.name | test("^github-action-")) | .owner.login + "/" + .name' > repos.txt

split -d -l 16 repos.txt repos-
51 changes: 51 additions & 0 deletions migrate/migrations/20240518/repos.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
cloudposse/github-action-test-action
cloudposse/github-action-atmos-get-setting
cloudposse/github-action-pre-commit
cloudposse/github-action-config-levels
cloudposse/github-action-atmos-terraform-drift-detection
cloudposse/github-action-matrix-outputs-write
cloudposse/github-action-setup-atmos
cloudposse/github-action-docker-build-push
cloudposse/github-action-docker-image-exists
cloudposse/github-action-docker-promote
cloudposse/github-action-deploy-argocd
cloudposse/github-action-deploy-helmfile
cloudposse/github-action-auto-release
cloudposse/github-action-preview-environment-controller
cloudposse/github-action-kubernetes-environment
cloudposse/github-action-yaml-config-query
cloudposse/github-action-run-ecspresso
cloudposse/github-action-terraform-plan-storage
cloudposse/github-action-jq
cloudposse/github-action-auto-format
cloudposse/github-action-sync-docker-repos
cloudposse/github-action-matrix-extended
cloudposse/github-action-atmos-terraform-select-components
cloudposse/github-action-atmos-terraform-apply
cloudposse/github-action-atmos-affected-trigger-spacelift
cloudposse/github-action-matrix-outputs-read
cloudposse/github-action-release-label-validator
cloudposse/github-action-atmos-terraform-plan
cloudposse/github-action-atmos-affected-stacks
cloudposse/github-action-atmos-terraform-drift-remediation
cloudposse/github-action-release-branch-manager
cloudposse/github-action-major-release-tagger
cloudposse/github-action-validate-codeowners
cloudposse/github-action-terraform-auto-context
cloudposse/github-action-atmos-component-updater
cloudposse/github-action-deploy-ecspresso
cloudposse/github-action-wait-commit-status
cloudposse/github-action-secret-outputs
cloudposse/github-action-interface-environment
cloudposse/github-action-terratest
cloudposse/github-action-spacelift-stack-deploy
cloudposse/github-action-aws-region-reduction-map
cloudposse/github-action-docker-compose-test-run
cloudposse/github-action-seek-deployment
cloudposse/github-action-preview-labels-cleanup
cloudposse/github-action-monorepo-random-controller
cloudposse/github-action-deploy-spacelift
cloudposse/github-action-telemetry
cloudposse/github-action-mega-linter
cloudposse/github-action-datadog-notify
cloudposse/github-action-pull-request-labeling
9 changes: 9 additions & 0 deletions migrate/migrations/20240518/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
title "Use GitHub Action Workflows from \`cloudposse/.github\` Repo"

install_github_settings
install .github/workflows
remove .github/workflows/feature-branch.yml
remove .github/workflows/main-branch.yml

# Merge the PR
auto_merge
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Main branch
name: Branch
on:
pull_request:
branches:
- main
- release/**
types: [opened, synchronize, reopened]
push:
branches:
- main
Expand All @@ -16,6 +21,6 @@ permissions:
actions: write

jobs:
perform:
uses: cloudposse/github-actions-workflows-github-action-composite/.github/workflows/main-branch.yml@main
github-action:
uses: cloudposse/.github/.github/workflows/shared-github-action.yml@main
secrets: inherit

This file was deleted.

4 changes: 2 additions & 2 deletions migrate/templates/github-action/.github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ permissions:
contents: write

jobs:
perform:
uses: cloudposse/github-actions-workflows-github-action-composite/.github/workflows/release.yml@main
github-action:
uses: cloudposse/.github/.github/workflows/shared-release-branches.yml@main
secrets: inherit

0 comments on commit 9f2a18b

Please sign in to comment.