diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml new file mode 100644 index 0000000..b6eb52f --- /dev/null +++ b/.github/workflows/branch.yml @@ -0,0 +1,26 @@ +name: Branch +on: + pull_request: + branches: + - main + - release/** + types: [opened, synchronize, reopened] + push: + branches: + - main + - release/v* + paths-ignore: + - '.github/**' + - 'docs/**' + - 'examples/**' + - 'test/**' + - 'README.md' + +permissions: + contents: write + actions: write + +jobs: + github-action: + uses: cloudposse/.github/.github/workflows/shared-github-action.yml@main + secrets: inherit diff --git a/.github/workflows/test-positive.yml b/.github/workflows/test-positive.yml new file mode 100644 index 0000000..2f90b94 --- /dev/null +++ b/.github/workflows/test-positive.yml @@ -0,0 +1,193 @@ +name: Test Action + +on: + workflow_dispatch: + inputs: + test_tag: + description: "Tag to test with" + required: false + default: "test-v1.0.0" + +jobs: + test-lightweight-tag: + runs-on: ubuntu-latest + env: + TAG_REF: test-lightweight-v1.0.0 + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Create test lightweight tag + run: | + git tag test-lightweight-v1.0.0 + git push origin test-lightweight-v1.0.0 + + - name: Test action with lightweight tag + id: test_lightweight + uses: ./ + with: + tag_ref: ${{ env.TAG_REF }} + branch: test-branch-lightweight-${{ env.TAG_REF }} + update_if_exists: "false" + + - name: Verify outputs + run: | + echo "Branch name: ${{ steps.test_lightweight.outputs.branch_name }}" + echo "Branch URL: ${{ steps.test_lightweight.outputs.branch_url }}" + echo "Created: ${{ steps.test_lightweight.outputs.created }}" + + # Verify branch was created + if [ "${{ steps.test_lightweight.outputs.created }}" != "true" ]; then + echo " Expected created=true for new branch" + exit 1 + fi + + if [ "${{ steps.test_lightweight.outputs.branch_name }}" != "test-branch-lightweight-${{ env.TAG_REF }}" ]; then + echo " Unexpected branch name" + exit 1 + fi + + test-annotated-tag: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Create test annotated tag + run: | + git config user.name "Test Bot" + git config user.email "test@example.com" + git tag -a test-annotated-v1.0.0 -m "Test annotated tag" + git push origin test-annotated-v1.0.0 + + - name: Test action with annotated tag + id: test_annotated + uses: ./ + with: + tag_ref: test-annotated-v1.0.0 + branch: test-branch-annotated + + - name: Verify outputs + run: | + echo "Branch name: ${{ steps.test_annotated.outputs.branch_name }}" + echo "Branch URL: ${{ steps.test_annotated.outputs.branch_url }}" + echo "Created: ${{ steps.test_annotated.outputs.created }}" + + test-update-existing: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Create test tag + run: | + git config user.name "Test Bot" + git config user.email "test@example.com" + git tag test-update-v1.0.0 + git push origin test-update-v1.0.0 + + - name: First run - create branch + id: first_run + uses: ./ + with: + tag_ref: test-update-v1.0.0 + branch: test-branch-update + + - name: Second run - update branch + id: second_run + uses: ./ + with: + tag_ref: test-update-v1.0.0 + branch: test-branch-update + update_if_exists: "true" + + - name: Third run - should update (update_if_exists=true) + id: third_run + uses: ./ + with: + tag_ref: test-update-v1.0.0 + branch: test-branch-update + update_if_exists: "true" + + - name: Verify behavior + run: | + # First run should create + if [ "${{ steps.first_run.outputs.created }}" != "true" ]; then + echo " First run should have created branch" + exit 1 + fi + + # Second run should skip + if [ "${{ steps.second_run.outputs.created }}" != "false" ]; then + echo " Second run should not have created branch" + exit 1 + fi + + # Third run should update (not create) + if [ "${{ steps.third_run.outputs.created }}" != "false" ]; then + echo " Third run should not have created branch (update only)" + exit 1 + fi + + test-error-handling: + runs-on: ubuntu-latest + env: + TAG_REF: non-existent-tag-v999.999.999 + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Test with non-existent tag + id: test_missing_tag + uses: ./ + continue-on-error: true + with: + tag_ref: ${{ env.TAG_REF }} + branch: test-error-${{ env.TAG_REF }} + + - name: Verify error handling + run: | + if [ "${{ steps.test_missing_tag.outcome }}" != "failure" ]; then + echo " Action should have failed with non-existent tag" + exit 1 + fi + echo "Error handling works correctly" + + cleanup: + runs-on: ubuntu-latest + needs: + [ + test-lightweight-tag, + test-annotated-tag, + test-update-existing, + test-error-handling, + ] + if: always() + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Cleanup test tags and branches + run: | + git config user.name "Test Bot" + git config user.email "test@example.com" + + # Delete test tags + git push --delete origin test-lightweight-v1.0.0 || true + git push --delete origin test-annotated-v1.0.0 || true + git push --delete origin test-update-v1.0.0 || true + + # Delete test branches + git push --delete origin test-release@test-lightweight-v1.0.0 || true + git push --delete origin test-release@test-annotated-v1.0.0 || true + git push --delete origin test-update@test-update-v1.0.0 || true diff --git a/README.md b/README.md index d0491a5..f27a55c 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ + -# github-action-typescript-template [![Latest Release](https://img.shields.io/github/release/cloudposse/github-action-typescript-template.svg)](https://github.com/cloudposse/github-action-typescript-template/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com) - +# github-action-typescript-template + -[![README Header][readme_header_img]][readme_header_link] +Latest ReleaseSlack Community -[![Cloud Posse][logo]](https://cpco.io/homepage) + + +| Name | Description | Default | Required | +|------|-------------|---------|----------| +| milliseconds | input description here | 200 | true | + -## Share the Love - -Like this project? Please give it a β˜… on [our GitHub](https://github.com/cloudposse/github-action-typescript-template)! (it helps us **a lot**) - -Are you using this project or any of our other projects? Consider [leaving a testimonial][testimonial]. =) @@ -101,86 +78,55 @@ For additional context, refer to some of these links. - [example-github-action-release-workflow](https://github.com/cloudposse/example-github-action-release-workflow) - Example application with complicated release workflow -## Help - -**Got a question?** We got answers. - -File a GitHub [issue](https://github.com/cloudposse/github-action-typescript-template/issues), send us an [email][email] or join our [Slack Community][slack]. - -[![README Commercial Support][readme_commercial_support_img]][readme_commercial_support_link] - -## DevOps Accelerator for Startups - - -We are a [**DevOps Accelerator**][commercial_support]. We'll help you build your cloud infrastructure from the ground up so you can own it. Then we'll show you how to operate it and stick around for as long as you need us. -[![Learn More](https://img.shields.io/badge/learn%20more-success.svg?style=for-the-badge)][commercial_support] -Work directly with our team of DevOps experts via email, slack, and video conferencing. +## ✨ Contributing -We deliver 10x the value for a fraction of the cost of a full-time engineer. Our track record is not even funny. If you want things done right and you need it done FAST, then we're your best bet. +This project is under active development, and we encourage contributions from our community. -- **Reference Architecture.** You'll get everything you need from the ground up built using 100% infrastructure as code. -- **Release Engineering.** You'll have end-to-end CI/CD with unlimited staging environments. -- **Site Reliability Engineering.** You'll have total visibility into your apps and microservices. -- **Security Baseline.** You'll have built-in governance with accountability and audit logs for all changes. -- **GitOps.** You'll be able to operate your infrastructure via Pull Requests. -- **Training.** You'll receive hands-on training so your team can operate what we build. -- **Questions.** You'll have a direct line of communication between our teams via a Shared Slack channel. -- **Troubleshooting.** You'll get help to triage when things aren't working. -- **Code Reviews.** You'll receive constructive feedback on Pull Requests. -- **Bug Fixes.** We'll rapidly work with you to fix any bugs in our projects. -## Slack Community -Join our [Open Source Community][slack] on Slack. It's **FREE** for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build totally *sweet* infrastructure. +Many thanks to our outstanding contributors: -## Discourse Forums + + + -Participate in our [Discourse Forums][discourse]. Here you'll find answers to commonly asked questions. Most questions will be related to the enormous number of projects we support on our GitHub. Come here to collaborate on answers, find solutions, and get ideas about the products and services we value. It only takes a minute to get started! Just sign in with SSO using your GitHub account. - -## Newsletter - -Sign up for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover. - -## Office Hours - -[Join us every Wednesday via Zoom][office_hours] for our weekly "Lunch & Learn" sessions. It's **FREE** for everyone! - -[![zoom](https://img.cloudposse.com/fit-in/200x200/https://cloudposse.com/wp-content/uploads/2019/08/Powered-by-Zoom.png")][office_hours] - -## Contributing - -### Bug Reports & Feature Requests - -Please use the [issue tracker](https://github.com/cloudposse/github-action-typescript-template/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](https://cpco.io/help-out) with our other projects, we would love to hear from you! Shoot us an [email][email]. +For πŸ› bug reports & feature requests, please use the [issue tracker](https://github.com/cloudposse/github-action-typescript-template/issues). In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow. - - 1. **Fork** the repo on GitHub - 2. **Clone** the project to your own machine - 3. **Commit** changes to your own branch - 4. **Push** your work back up to your fork - 5. Submit a **Pull Request** so that we can review your changes + 1. Review our [Code of Conduct](https://github.com/cloudposse/github-action-typescript-template/?tab=coc-ov-file#code-of-conduct) and [Contributor Guidelines](https://github.com/cloudposse/.github/blob/main/CONTRIBUTING.md). + 2. **Fork** the repo on GitHub + 3. **Clone** the project to your own machine + 4. **Commit** changes to your own branch + 5. **Push** your work back up to your fork + 6. Submit a **Pull Request** so that we can review your changes **NOTE:** Be sure to merge the latest changes from "upstream" before making a pull request! +### 🌎 Slack Community -## Copyright +Join our [Open Source Community](https://cpco.io/slack?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=slack) on Slack. It's **FREE** for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build totally *sweet* infrastructure. -Copyright Β© 2017-2023 [Cloud Posse, LLC](https://cpco.io/copyright) +### πŸ“° Newsletter +Sign up for [our newsletter](https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=newsletter) and join 3,000+ DevOps engineers, CTOs, and founders who get insider access to the latest DevOps trends, so you can always stay in the know. +Dropped straight into your Inbox every week β€” and usually a 5-minute read. +### πŸ“† Office Hours +[Join us every Wednesday via Zoom](https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=office_hours) for your weekly dose of insider DevOps trends, AWS news and Terraform insights, all sourced from our SweetOps community, plus a _live Q&A_ that you can’t find anywhere else. +It's **FREE** for everyone! ## License -[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) +License + +
+Preamble to the Apache License, Version 2.0 +
+
-See [LICENSE](LICENSE) for full details. +Complete license is available in the [`LICENSE`](LICENSE) file. ```text Licensed to the Apache Software Foundation (ASF) under one @@ -200,74 +146,17 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ``` - - - - - - - - +
## Trademarks All other trademarks referenced herein are the property of their respective owners. -## About - -This project is maintained and funded by [Cloud Posse, LLC][website]. Like it? Please let us know by [leaving a testimonial][testimonial]! - -[![Cloud Posse][logo]][website] - -We're a [DevOps Professional Services][hire] company based in Los Angeles, CA. We ❀️ [Open Source Software][we_love_open_source]. - -We offer [paid support][commercial_support] on all of our projects. -Check out [our other projects][github], [follow us on twitter][twitter], [apply for a job][jobs], or [hire us][hire] to help with your cloud strategy and implementation. - - - -### Contributors +--- +Copyright © 2017-2025 [Cloud Posse, LLC](https://cpco.io/copyright) - -| [![Matt Calhoun][mcalhoun_avatar]][mcalhoun_homepage]
[Matt Calhoun][mcalhoun_homepage] | -|---| - - [mcalhoun_homepage]: https://github.com/mcalhoun - [mcalhoun_avatar]: https://img.cloudposse.com/150x150/https://github.com/mcalhoun.png +README footer -[![README Footer][readme_footer_img]][readme_footer_link] -[![Beacon][beacon]][website] - - [logo]: https://cloudposse.com/logo-300x69.svg - [docs]: https://cpco.io/docs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=docs - [website]: https://cpco.io/homepage?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=website - [github]: https://cpco.io/github?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=github - [jobs]: https://cpco.io/jobs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=jobs - [hire]: https://cpco.io/hire?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=hire - [slack]: https://cpco.io/slack?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=slack - [linkedin]: https://cpco.io/linkedin?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=linkedin - [twitter]: https://cpco.io/twitter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=twitter - [testimonial]: https://cpco.io/leave-testimonial?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=testimonial - [office_hours]: https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=office_hours - [newsletter]: https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=newsletter - [discourse]: https://ask.sweetops.com/?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=discourse - [email]: https://cpco.io/email?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=email - [commercial_support]: https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=commercial_support - [we_love_open_source]: https://cpco.io/we-love-open-source?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=we_love_open_source - [terraform_modules]: https://cpco.io/terraform-modules?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=terraform_modules - [readme_header_img]: https://cloudposse.com/readme/header/img - [readme_header_link]: https://cloudposse.com/readme/header/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=readme_header_link - [readme_footer_img]: https://cloudposse.com/readme/footer/img - [readme_footer_link]: https://cloudposse.com/readme/footer/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=readme_footer_link - [readme_commercial_support_img]: https://cloudposse.com/readme/commercial-support/img - [readme_commercial_support_link]: https://cloudposse.com/readme/commercial-support/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-typescript-template&utm_content=readme_commercial_support_link - [share_twitter]: https://twitter.com/intent/tweet/?text=github-action-typescript-template&url=https://github.com/cloudposse/github-action-typescript-template - [share_linkedin]: https://www.linkedin.com/shareArticle?mini=true&title=github-action-typescript-template&url=https://github.com/cloudposse/github-action-typescript-template - [share_reddit]: https://reddit.com/submit/?url=https://github.com/cloudposse/github-action-typescript-template - [share_facebook]: https://facebook.com/sharer/sharer.php?u=https://github.com/cloudposse/github-action-typescript-template - [share_googleplus]: https://plus.google.com/share?url=https://github.com/cloudposse/github-action-typescript-template - [share_email]: mailto:?subject=github-action-typescript-template&body=https://github.com/cloudposse/github-action-typescript-template - [beacon]: https://ga-beacon.cloudposse.com/UA-76589703-4/cloudposse/github-action-typescript-template?pixel&cs=github&cm=readme&an=github-action-typescript-template - +Beacon diff --git a/atmos.yaml b/atmos.yaml new file mode 100644 index 0000000..e77388d --- /dev/null +++ b/atmos.yaml @@ -0,0 +1,12 @@ +# Atmos Configuration β€” powered by https://atmos.tools +# +# This configuration enables centralized, DRY, and consistent project scaffolding using Atmos. +# +# Included features: +# - Organizational custom commands: https://atmos.tools/core-concepts/custom-commands +# - Automated README generation: https://atmos.tools/cli/commands/docs/generate +# + +# Import shared configuration used by all modules +import: + - https://raw.githubusercontent.com/cloudposse/.github/refs/heads/main/.github/atmos/github-action.yaml \ No newline at end of file