{"id":24678327,"url":"https://github.com/firstclasspostcodes/github-action","last_synced_at":"2025-03-21T18:23:37.651Z","repository":{"id":54416909,"uuid":"257211465","full_name":"firstclasspostcodes/github-action","owner":"firstclasspostcodes","description":"🎡 GitHub Actions for deploying AWS infrastructure using CloudFormation and triggering workflows using EventBridge/CloudWatch events.","archived":false,"fork":false,"pushed_at":"2021-02-19T07:19:01.000Z","size":8457,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-26T13:16:33.753Z","etag":null,"topics":["aws","eventbridge","github-actions","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/firstclasspostcodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-20T07:59:54.000Z","updated_at":"2022-05-01T23:32:09.000Z","dependencies_parsed_at":"2022-08-13T15:00:54.086Z","dependency_job_id":null,"html_url":"https://github.com/firstclasspostcodes/github-action","commit_stats":null,"previous_names":[],"tags_count":64,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstclasspostcodes%2Fgithub-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstclasspostcodes%2Fgithub-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstclasspostcodes%2Fgithub-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstclasspostcodes%2Fgithub-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firstclasspostcodes","download_url":"https://codeload.github.com/firstclasspostcodes/github-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244845421,"owners_count":20519958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","eventbridge","github-actions","javascript"],"created_at":"2025-01-26T13:16:40.428Z","updated_at":"2025-03-21T18:23:37.615Z","avatar_url":"https://github.com/firstclasspostcodes.png","language":"JavaScript","readme":"# GitHub Action\n\nThe actions defined in this repository, help us to deploy with AWS CloudFormation \u0026 integrate with our AWS environment, using GitHub actions.\n\nIncluded actions help you to:\n\n- Package AWS templates `aws cloudformation package`.\n- Create/Update AWS CloudFormation stacks.\n- Delete AWS CloudFormation stacks.\n- Read stack outputs and output them as step outputs.\n- Read SSM Parameter Store parameters and output them as step outputs.\n- Trigger workflows when certain AWS EventBridge / CloudWatch events are triggered.\n\nBelow is an example of its usage:\n\n```yml\nname: Deploy\n\non:\n  - push\n  # Start this workflow when a repository dispatch event is received\n  # that matches this type.\n  #\n  # Configuring this trigger is demonstrated below, in the `clouformation/triggers` action.\n  - repository_dispatch:\n      types: [my-parameter-trigger]\n\njobs:\n  deploy:\n    name: Deploy my service\n    runs-on: ubuntu-latest\n\n    strategy:\n      matrix:\n        # Set a matrix to deploy to multiple regions in parallel.\n        region: [eu-west-1, us-east-1]\n\n    env:\n      # You will need to set required AWS credentials as environment variables.\n      AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}\n      AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n      AWS_REGION: ${{ matrix.region }}\n\n    steps:\n      # Using the CloudFormation triggers action enables you to start your workflow,\n      # when certain AWS EventBridge or AWS CloudWatch events are triggered inside\n      # your AWS account.\n      #\n      # This action works by deploying an AWS CloudFormation stack that matches the\n      # repository name, suffixed with the name property you provide. This allows\n      # you to deploy multiple triggers that start different workflows, if necessary.\n      # The CloudFormation stack deploys a pre-configured AWS Lambda function that\n      # is triggered from the configured EventBridge/CloudWatch event pattern.\n      #\n      # Note: For this action to work, you will need to configure a repo scoped\n      # GitHub personal access token and set it as a secret. In the example below,\n      # we've used \"AWS_TRIGGER_TOKEN\", which is a GitHub personal access token.\n      - name: 'cloudformation/triggers'\n        uses: firstclasspostcodes/github-action/cloudformation/triggers@v3.0.0\n        with:\n          # Required: set a unique name for the created CloudFormation stack.\n          name: my-parameter-trigger-rule\n          # Required: Pass a GitHub token with repo scope. This CANNOT be the token\n          # that has been created for this workflow execution.\n          token: ${{ secrets.AWS_TRIGGER_TOKEN }}\n          # Required: Set the type (name) of the event that will be dispatched to\n          # the repository.\n          event-type: my-parameter-trigger\n          # Required: Configure the event matching pattern that will be used to\n          # trigger repository event dispatches.\n          #\n          # See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatchEventsandEventPatterns.html\n          event-pattern: |\n            {\n              \"source\": [\"aws.ssm\"],\n              \"detail\": {\n                \"operation\": [\"Update\"],\n                \"name\": [\"/Test/Path/Parameter/FakeName\"]\n              }\n            }\n\n      # This action uses the command-line action `aws clouformation package` and uploads\n      # the output template file to an workflow artifact.\n      #\n      # For more information about what this action does, see:\n      #\n      # https://docs.aws.amazon.com/cli/latest/reference/cloudformation/package.html\n      - name: 'cloudforation/package-template'\n        uses: firstclasspostcodes/github-action/cloudformation/package-template@v3.0.0\n        with:\n          # Required: Pass a relative filepath to the template, from the root of the repository.\n          template-file: ./examples/template.yml\n          # Required: The name of an AWS S3 Bucket that packaged resources will be\n          # uploaded to.\n          s3-bucket: packaged-resources-s3-bucket-name\n          # Optional: The S3 key prefix that resources will be uploaded under.\n          s3-prefix: s3-key-prefix\n          # Optional: If required, you can also pass a KMS Key ID for artifacts\n          # to be uploaded with.\n          kms-key-id: 3456-cdsw2-tyhjnbv-q2345tyhbvcx\n          # Required: The name of the artifact to be uploaded.\n          artifact-name: example-artifact-name\n\n      # Use this action to deploy a CloudFormation template directly from the repository\n      # or from a packaged artifact name.\n      #\n      # Stacks are deployed using `create-change-set` and `execute-change-set`, stacks\n      # will either be created, or updated if they already exist. If no updates are to\n      # be performed, this action will exit successfully and has no effect.\n      - name: 'cloudformation/deploy'\n        uses: firstclasspostcodes/github-action/cloudformation/deploy@v3.0.0\n        with:\n          # Optional: Pass through a valid JSON object for required parameters.\n          #\n          # Parameters can either be a string, or an object (as demonstrated below).\n          #\n          # If you need to pass an object, see the \"Parameters\" definition here;\n          # https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudFormation.html#createChangeSet-property\n          parameters: |\n            {\n              \"SimpleParameterExample\": \"this-is-a-test-value\",\n              \"PreviousExampleValue\": {\n                \"UsePreviousValue\": true\n              }\n            }\n          # Optional: Pass through a valid JSON object of tags.\n          #\n          # Tags added to CloudFormation stacks are also added to supported resources\n          # that are deployed by the stack. Passing through the ref and sha helps you to\n          # diagnose issues with releases.\n          tags: |\n            {\n              \"Release\": \"${{ github.ref }}\",\n              \"SHA\": \"${{ github.sha }}\"\n            }\n          # Optional: A comma-delimited list of capabilities that the deployment requires.\n          # The default value is set to the example value.\n          capabilities: 'CAPABILITY_IAM,CAPABILITY_AUTO_EXPAND'\n          # Required: Set the name the CloudFormation stack that will be deployed.\n          stack-name: example-test-stack\n          # Mutually exclusive: Pass a relative filepath to the template, from the root of the repository. You must provide either \"template-file\" OR \"artifact-name\", not both.\n          template-file: ./examples/template.yml\n          # Mutually exclusive: The name of the artifact to be downloaded and the template\n          # from inside it deployed. The template must be named: \"___template.yml\"\n          artifact-name: example-artifact-name\n\n      # The `cloudformation/run` action packages your CloudFormation template, deploys it and\n      # reads the stack outputs as step outputs, all in one handy action.\n      #\n      # The packaged template is also uploaded as a workflow artifact.\n      - name: 'cloudformation/run'\n        id: stack\n        uses: firstclasspostcodes/github-action/cloudformation/run@v3.0.0\n        with:\n          # Optional: Pass through a valid JSON object for required parameters.\n          #\n          # Parameters can either be a string, or an object (as demonstrated below).\n          #\n          # If you need to pass an object, see the \"Parameters\" definition here;\n          # https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudFormation.html#createChangeSet-property\n          parameters: |\n            {\n              \"SimpleParameterExample\": \"this-is-a-test-value\",\n              \"PreviousExampleValue\": {\n                \"UsePreviousValue\": true\n              }\n            }\n          # Optional: Pass through a valid JSON object of tags.\n          #\n          # Tags added to CloudFormation stacks are also added to supported resources\n          # that are deployed by the stack. Passing through the ref and sha helps you to\n          # diagnose issues with releases.\n          tags: |\n            {\n              \"Release\": \"${{ github.ref }}\",\n              \"SHA\": \"${{ github.sha }}\"\n            }\n          # Required: Set the name the CloudFormation stack that will be deployed.\n          stack-name: example-test-stack\n          # Required: Pass a relative filepath to the template, from the root of the repository.\n          template-file: ./examples/template.yml\n          # Required: The name of an AWS S3 Bucket that packaged resources will be\n          # uploaded to.\n          s3-bucket: packaged-resources-s3-bucket-name\n          # Optional: The S3 key prefix that resources will be uploaded under.\n          s3-prefix: s3-key-prefix\n          # Required: The name of the artifact to be uploaded.\n          artifact-name: example-artifact-name\n\n      # In the case of a deployment failure, you can use this action to retrieve\n      # and display a list of stack events. The retrieved stack events should include\n      # the reason why the deployment failed, this information is displayed in the console\n      # using Node's `console.table` function.\n      - name: 'cloudformation/errors'\n        if: failure()\n        uses: firstclasspostcodes/github-action/cloudformation/errors@v3.0.0\n        with:\n          # Required: Provide the name of the stack to list errors for.\n          stack-name: example-test-stack\n\n      # This action allows you to read the values of parameters that are stored in AWS SSM Parameter Store.\n      #\n      # This is useful for build processes that may require parameter values, etc.\n      #\n      # You provide a parameter name prefix and all the parameters under this prefix are read\n      # and their values included as step outputs. The names of parameters are snake-cased\n      # so that they're compatible with GitHub action syntax.\n      #\n      # For example, given a parameter named: /Master/Production/DatabaseName, this would\n      # be output as \"master-production-database-name\".\n      - name: 'cloudformation/read-parameters'\n        id: parameters\n        uses: firstclasspostcodes/github-action/cloudformation/read-parameters@v3.0.0\n        with:\n          # Required: The SSM Parameter Store path prefix\n          path: '/Master/Production'\n\n      # This example follows on from the step above, describing how you can use these\n      # parameters in subsequent job steps:\n      - name: Echo Parameter Output from \"cloudformation/read-parameters\"\n        run: echo $PARAMETER_VALUE\n        env:\n          PARAMETER_VALUE: ${{ steps.parameters.outputs.master-production-database-name }}\n\n      # Delete a CloudFormation stack. If the stack does not exist, then this action\n      # has no effect.\n      - name: 'cloudformation/delete'\n        uses: firstclasspostcodes/github-action/cloudformation/delete@v3.0.0\n        with:\n          # Required: The name of the CloudFormation stack to delete.\n          stack-name: example-test-stack\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstclasspostcodes%2Fgithub-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirstclasspostcodes%2Fgithub-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstclasspostcodes%2Fgithub-action/lists"}