From 2fc1e34f97fe6a27c408f1ec3aa961b743b469ee Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Fri, 17 May 2024 00:49:06 +0200 Subject: [PATCH 1/4] Consolidate shared workflows (#89) ## what * Consolidate shared workflows ## why * Reduce reusable workflows nested levels ## references * DEV-400: Move shared workflows into .github repo with shared- prefix --- .github/workflows/shared-github-action.yml | 79 +++++++++++++++++++ .../workflows/shared-terraform-chatops.yml | 26 ++++++ .github/workflows/shared-terraform-module.yml | 70 ++++++++++++++++ .../workflows/shared-terraform-scheduled.yml | 32 ++++++++ 4 files changed, 207 insertions(+) create mode 100644 .github/workflows/shared-github-action.yml create mode 100644 .github/workflows/shared-terraform-chatops.yml create mode 100644 .github/workflows/shared-terraform-module.yml create mode 100644 .github/workflows/shared-terraform-scheduled.yml diff --git a/.github/workflows/shared-github-action.yml b/.github/workflows/shared-github-action.yml new file mode 100644 index 00000000..ff4b79b8 --- /dev/null +++ b/.github/workflows/shared-github-action.yml @@ -0,0 +1,79 @@ +name: "Shared github action workflow" + +on: + workflow_call: + inputs: + organization: + description: "Repository owner organization (ex. acme for repo acme/example)" + required: false + default: ${{ github.event.repository.owner.login }} + type: string + repository: + description: "Repository name (ex. example for repo acme/example)" + required: false + default: ${{ github.event.repository.name }} + type: string + ref: + description: "The fully-formed ref of the branch or tag that triggered the workflow run" + required: false + default: ${{ github.ref }} + type: string + tests-prefix: + description: "Workflows file name prefix to run as tests" + required: false + type: string + default: 'test-*' + publish: + description: "Whether to publish a new release immediately" + required: false + default: "true" + type: string + runs-on: + description: "Overrides job runs-on setting (json-encoded list)" + type: string + required: false + default: '["ubuntu-latest"]' + +permissions: + contents: write + actions: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + ci-readme: + uses: cloudposse/github-actions-workflows/.github/workflows/ci-readme.yml@shared-workflows + name: "Readme" + if: ${{ github.event_name == 'push' }} + with: + runs-on: ${{ inputs.runs-on }} + secrets: inherit + + ci-gha: + uses: cloudposse/github-actions-workflows/.github/workflows/ci-github-action.yml@main + name: "CI" + with: + organization: ${{ inputs.organization }} + repository: ${{ inputs.repository }} + ref: ${{ inputs.ref }} + tests-prefix: ${{ inputs.tests-prefix }} + + ci: + runs-on: ${{ fromJSON(inputs.runs-on) }} + if: ${{ always() }} + steps: + - run: | + echo '${{ toJSON(needs) }}' # easier debug + ! ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + needs: [ ci-gha, ci-readme ] + + release: + needs: [ ci ] + name: "Release" + if: ${{ github.event_name == 'push' }} + uses: cloudposse/.github/.github/workflows/shared-auto-release.yml@main + with: + publish: ${{ inputs.publish }} + secrets: inherit diff --git a/.github/workflows/shared-terraform-chatops.yml b/.github/workflows/shared-terraform-chatops.yml new file mode 100644 index 00000000..7da9c33b --- /dev/null +++ b/.github/workflows/shared-terraform-chatops.yml @@ -0,0 +1,26 @@ +name: "Shared Terraform ChatOps" + +on: + workflow_call: + inputs: + runs-on: + description: "Overrides job runs-on setting (json-encoded list)" + type: string + required: false + default: '["ubuntu-latest"]' + secrets: + github_access_token: + description: "GitHub API token" + required: true + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + ci-terraform-chatops: + uses: cloudposse/github-actions-workflows/.github/workflows/ci-terraform-chatops.yml@main + with: + runs-on: ${{ inputs.runs-on }} + secrets: + github_access_token: ${{ secrets.github_access_token }} diff --git a/.github/workflows/shared-terraform-module.yml b/.github/workflows/shared-terraform-module.yml new file mode 100644 index 00000000..7648f8e0 --- /dev/null +++ b/.github/workflows/shared-terraform-module.yml @@ -0,0 +1,70 @@ +name: "Shared terraform module" +on: + workflow_call: + inputs: + runs-on: + description: "Overrides job runs-on setting (json-encoded list)" + type: string + required: false + default: '["ubuntu-latest"]' + secrets: + REPO_ACCESS_TOKEN: + description: "GitHub API token" + required: true + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + ci-terraform: + uses: cloudposse/github-actions-workflows/.github/workflows/ci-terraform.yml@shared-workflows + name: "CI" + with: + # Workaround for https://github.com/community/community/discussions/9099 + # We should switch to nofilter once it's fixed + filter-mode: ${{ github.event_name == 'pull_request' && 'diff_context' || 'nofilter' }} + suggestions: "${{ github.event_name == 'pull_request' }}" + runs-on: ${{ inputs.runs-on }} + + ci-readme: + uses: cloudposse/github-actions-workflows/.github/workflows/ci-readme.yml@shared-workflows + name: "Readme" + if: ${{ github.event_name == 'push' }} + with: + runs-on: ${{ inputs.runs-on }} + secrets: inherit + + ci-codeowners: + uses: cloudposse/github-actions-workflows/.github/workflows/ci-codeowners.yml@shared-workflows + name: "CI" + with: + is_fork: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }} + runs-on: ${{ inputs.runs-on }} + secrets: + github_access_token: ${{ secrets.REPO_ACCESS_TOKEN }} + + ci-labels: + runs-on: ${{ fromJSON(inputs.runs-on) }} + name: "CI / Labels Validate" + steps: + - uses: cloudposse/github-action-release-label-validator@v1 + + ci: + runs-on: ${{ fromJSON(inputs.runs-on) }} + if: ${{ always() }} + steps: + - run: | + echo '${{ toJSON(needs) }}' # easier debug + ! ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + needs: [ ci-terraform, ci-readme, ci-codeowners, ci-labels ] + + auto-release: + name: "Release" + needs: [ci] + uses: cloudposse/.github/.github/workflows/shared-auto-release.yml@shared-workflows + if: ${{ github.event_name == 'push' }} + with: + runs-on: ${{ inputs.runs-on }} + publish: true + secrets: inherit diff --git a/.github/workflows/shared-terraform-scheduled.yml b/.github/workflows/shared-terraform-scheduled.yml new file mode 100644 index 00000000..c53189b6 --- /dev/null +++ b/.github/workflows/shared-terraform-scheduled.yml @@ -0,0 +1,32 @@ +name: "Shared terraform scheduled" + +on: + workflow_call: + inputs: + runs-on: + description: "Overrides job runs-on setting (json-encoded list)" + type: string + required: false + default: '["ubuntu-latest"]' + secrets: + REPO_ACCESS_TOKEN: + description: "GitHub API token" + required: true + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + context: + uses: cloudposse/github-actions-workflows/.github/workflows/scheduled-context.yml@main + with: + runs-on: ${{ inputs.runs-on }} + secrets: + github_access_token: ${{ secrets.REPO_ACCESS_TOKEN }} + + readme: + uses: cloudposse/github-actions-workflows/.github/workflows/scheduled-readme.yml@main + with: + runs-on: ${{ inputs.runs-on }} + secrets: inherit From aa1964cf6cc111715c1a77877eca29037be73150 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Fri, 17 May 2024 22:27:01 +0200 Subject: [PATCH 2/4] [share github action workflow] Fix default ref (#93) --- .github/workflows/shared-github-action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/shared-github-action.yml b/.github/workflows/shared-github-action.yml index ff4b79b8..205a4c01 100644 --- a/.github/workflows/shared-github-action.yml +++ b/.github/workflows/shared-github-action.yml @@ -16,7 +16,7 @@ on: ref: description: "The fully-formed ref of the branch or tag that triggered the workflow run" required: false - default: ${{ github.ref }} + default: ${{ github.sha }} type: string tests-prefix: description: "Workflows file name prefix to run as tests" From 3dae3efebf9ec0d7f5809f5fb94dd9dbdbe022e2 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Fri, 17 May 2024 22:56:59 +0200 Subject: [PATCH 3/4] [shared github action workflow] Get rid of ref input (#94) --- .github/workflows/shared-github-action.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/shared-github-action.yml b/.github/workflows/shared-github-action.yml index 205a4c01..7be28dc5 100644 --- a/.github/workflows/shared-github-action.yml +++ b/.github/workflows/shared-github-action.yml @@ -13,11 +13,6 @@ on: required: false default: ${{ github.event.repository.name }} type: string - ref: - description: "The fully-formed ref of the branch or tag that triggered the workflow run" - required: false - default: ${{ github.sha }} - type: string tests-prefix: description: "Workflows file name prefix to run as tests" required: false @@ -57,7 +52,7 @@ jobs: with: organization: ${{ inputs.organization }} repository: ${{ inputs.repository }} - ref: ${{ inputs.ref }} + ref: ${{ github.event_name == 'push' && github.ref || github.event.pull_request.head.ref }} tests-prefix: ${{ inputs.tests-prefix }} ci: From 483114922212fb7171c99245e76d6a0525d71f6a Mon Sep 17 00:00:00 2001 From: "Erik Osterman (CEO @ Cloud Posse)" Date: Fri, 17 May 2024 17:21:30 -0500 Subject: [PATCH 4/4] Update README template to use canonical URLs (#95) * Update README template to use canonical URLs * Fix URL * Fix URL --- README.md | 20 +++++++------------- README.md.gotmpl | 9 +++++---- profile/README.md | 19 ++++++++++--------- 3 files changed, 22 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 798e92d0..5355e4d8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -Project Banner
+Project Banner

Last UpdateSlack Community

@@ -51,10 +51,6 @@ This repository fulfills several unique functions functions for the Cloud Posse - - - - ## Examples To add all repository bootstrapping files to a new repo: @@ -66,23 +62,21 @@ To add all repository bootstrapping files to a new repo: + + ## ✨ Contributing This project is under active development, and we encourage contributions from our community. + + + Many thanks to our outstanding contributors: -### 🐛 Bug Reports & Feature Requests - -Please use the [issue tracker](https://github.com/cloudposse/.github/issues) to report any bugs or file feature requests. - -### 💻 Developing - -If you are interested in being a contributor and want to get involved in developing this project or help out with Cloud Posse's other projects, we would love to hear from you! -Hit us up in [Slack](https://cpco.io/slack?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/.github&utm_content=slack), in the `#cloudposse` channel. +For 🐛 bug reports & feature requests, please use the [issue tracker](https://github.com/cloudposse/.github/issues). In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow. 1. Review our [Code of Conduct](https://github.com/cloudposse/.github/?tab=coc-ov-file#code-of-conduct) and [Contributor Guidelines](https://github.com/cloudposse/.github/blob/main/CONTRIBUTING.md). diff --git a/README.md.gotmpl b/README.md.gotmpl index de9bcfb9..422823ac 100644 --- a/README.md.gotmpl +++ b/README.md.gotmpl @@ -3,6 +3,7 @@ {{- $deprecated := has (ds "config") "deprecated" }} {{- $is_terraform := (strings.Contains "terraform-" ((ds "config").github_repo)) -}} {{- $utm_link := printf "%%s?utm_source=%s&utm_medium=%s&utm_campaign=%s&utm_content=%s" "github" "readme" (ds "config").github_repo "%s" -}} +{{- $banner := printf "https://github.com/%s/blob/main/.github/banner.png?raw=true" (ds "config").github_repo -}} {{- $homepage := printf $utm_link "https://cpco.io/homepage" "" -}} {{- $logo := "https://cloudposse.com/logo-300x69.svg" -}} {{- $terraform_modules := printf $utm_link "https://cpco.io/terraform-modules" "terraform_modules" -}} @@ -38,9 +39,9 @@ > > Use Cloud Posse's ready-to-go [terraform architecture blueprints](https://cloudposse.com/reference-architecture/) for AWS to get up and running quickly. > -> ✅ We build it with you.
-> ✅ You own everything.
-> ✅ Your team wins.
+> ✅ We build it together with your team.
+> ✅ Your team owns everything.
+> ✅ 100% Open Source and backed by fanatical support.
> > {{ .cta }} >
📚 Learn More @@ -80,7 +81,7 @@ # (deprecated) {{(ds "config").name}} {{- else }} {{- if (file.Exists ".github/banner.png") -}} - Project Banner
+ Project Banner
{{ if has (ds "config") "badges" }}

{{- end -}} {{- else -}} # {{(ds "config").name}} diff --git a/profile/README.md b/profile/README.md index 4c0ab080..62527af4 100644 --- a/profile/README.md +++ b/profile/README.md @@ -5,20 +5,21 @@ Request Quote

- > [!IMPORTANT] > ### We're a DevOps Accelerator for Funded Startups and Enterprises -> -> Use our ready-to-go [terraform architecture blueprints](https://cloudposse.com/services/) for AWS to get up and running quickly. -> -> ✅ We build it with you.
-> ✅ You own everything.
-> ✅ Your team wins.
+> +> Skip the consultants and the DIY headaches. +> +> Use our ready-to-go [terraform architecture blueprints](https://cloudposse.com/) for AWS to get up and running quickly. +> +> ✅ Production-ready AWS infrastructure in weeks, not months
+> ✅ Backed by our fanatical support
+> ✅ So good, we offer a money-back guarantee
> > [![Request Quote](https://img.shields.io/badge/Request_Quote-success.svg?style=for-the-badge)](https://cloudposse.com/quiz/) > -> Just browsing? Kickstart your journey with [Atmos](https://atmos.tools), dive into discussions on [Slack](https://slack.cloudposse.com), and get insights at our weekly [office hours](https://cloudposse.com/office-hours). Discover how Cloud Posse's open-source solutions can elevate your organization. -> +> Just browsing? Kickstart your journey with [Atmos](https://atmos.tools), dive into discussions on [Slack](https://slack.cloudposse.com), and gain insights on our weekly [office hours](https://cloudposse.com/office-hours). Discover how Cloud Posse's open-source solutions can elevate your organization. +> >
> 💡 Learn More about Cloud Posse >