aws-cloudformation / rain

A development workflow tool for working with AWS CloudFormation.
Apache License 2.0
780 stars 69 forks source link

Consider making this a GitHub Action? #109

Open FollowTheProcess opened 1 year ago

FollowTheProcess commented 1 year ago

Hello! 👋🏻

Just found this project whilst doing some cloudformation at work and instantly found it useful! What would be even better is it were available as a GitHub action so we can validate formatting of cloudformation templates with rain fmt --verify as part of CI.

Is this anywhere on the plan? Would you be happy to go in this direction? If so I can probably put something together to achieve this :)

ericzbeard commented 1 year ago

Is this something that warrants an action for just this one thing, or should it be incorporated into other CI actions?

FollowTheProcess commented 1 year ago

Maybe not? Just would be a nice little feature, even as a composite action or something. Currently I have the following set up which works fine:

  cloudformation-fmt:
    name: Format CloudFormation Templates
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Code
        uses: actions/checkout@v3

      - name: Setup Cloud Formation Formatter
        run: |
          gh release download --repo aws-cloudformation/rain --pattern "*_linux-amd64.zip" --output "rain.zip"
          unzip -j "rain.zip" "*/rain"
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Check Formatting
        run: ./rain fmt --verify template.yaml app.yaml