{"id":7745500,"name":"cloudify-cosmo/cloudify-comment-action","ecosystem":"actions","description":"parse issue comment then pass action to Cloudify.","homepage":null,"licenses":null,"normalized_licenses":[],"repository_url":"https://github.com/cloudify-cosmo/cloudify-comment-action","keywords_array":[],"namespace":"cloudify-cosmo","versions_count":2,"first_release_published_at":"2022-03-21T12:35:13.000Z","latest_release_published_at":"2022-10-05T13:01:00.000Z","latest_release_number":"v1.3","last_synced_at":"2026-05-06T22:31:26.640Z","created_at":"2023-05-17T10:13:42.192Z","updated_at":"2026-05-06T22:31:26.640Z","registry_url":"https://github.com/cloudify-cosmo/cloudify-comment-action","install_command":null,"documentation_url":null,"metadata":{"name":"Parse Cloudify Related comments","description":"parse issue comment then pass action to Cloudify.","branding":{"icon":"cloud","color":"white"},"inputs":{"comment":{"description":"comment to parse and take action based on","required":true},"github_token":{"description":"github token that will be used to add comment to PR","default":"-","required":false},"environment-name":{"description":"Name of Cloudify environment","required":false,"default":"-"},"environment-id":{"description":"ID of Cloudify environment","required":false,"default":"-"},"labels":{"description":"A labels list of the form \u003ckey\u003e:\u003cvalue\u003e,\u003ckey\u003e:\u003cvalue\u003e.\nAny comma and colon in \u003cvalue\u003e must be escaped with \\.\nThe labels’ keys are saved in lowercase.\n","required":false,"default":"-"},"module-file":{"description":"URL/path to Terraform module archive","required":false,"default":"-"},"module-source-path":{"description":"path to Terraform module inside the archive","required":false,"default":"-"},"variables-file":{"description":"YAML/JSON file containing template variables","required":false,"default":"-"},"environment-file":{"description":"YAML/JSON file containing environment variables to pass to the Terraform process\n","required":false,"default":"-"},"environment-mapping":{"description":"A whitespace-delimited list of strings. For each item:\n\n* If it is of the form `k=v`, then the value of the environment variable `k` is passed\n  as environment variable `v` to Terraform\n* Otherwise, let the value be `x`; then the environment variable `x` is passed as-is\n  to Terraform\n\nThis effectively passes environment variables, visible to the CI/CD platform,\nas environment variables to Terraform. Useful, among others, for\npassing Cloud credentials - stored in the CI/CD platform - to Terraform\n","required":false,"default":"-"},"skip-apply-comment":{"description":"boolean to control whether to add terraform apply comment to PR","default":"false","required":false},"infracost-api-key":{"description":"infracost api key [requrired in case you want to use cost comment action]","default":"false","required":false}},"outputs":{"result":{"description":"Comment handling result","value":"${{ steps.terraform_apply.outputs.terraform-outputs || steps.terraform_plan.outputs.terraform-plan || steps.format_command.outputs.result }}"}},"runs":{"using":"composite","steps":[{"name":"Check if comment starts with cfy and remove it","id":"format_comment","shell":"python","run":"comment = \"${{ inputs.comment }}\"\ncomment = comment.strip()\nif comment.startswith('cfy'):\n  comment = comment.replace('cfy', '', 1).strip()\nprint ('::set-output name=command::{0}'.format(comment))\n"},{"name":"Get PR SHA","id":"sha","if":"${{ startsWith(steps.format_comment.outputs.command, 'terraform') }}","uses":"actions/github-script@v4","with":{"result-encoding":"string","script":"const { owner, repo, number } = context.issue;\nconst pr = await github.pulls.get({\n  owner,\n  repo,\n  pull_number: number,\n});\nreturn pr.data.head.sha\n"}},{"name":"Checkout code","if":"${{ startsWith(steps.format_comment.outputs.command, 'terraform') }}","uses":"actions/checkout@v2","with":{"ref":"${{ steps.sha.outputs.result }}"}},{"name":"Get PR Repo Link","id":"get_repo_link","if":"${{ inputs.module-file == '-' \u0026\u0026 startsWith(steps.format_comment.outputs.command, 'terraform')  }}","uses":"actions/github-script@v4","with":{"result-encoding":"string","script":"const { owner, repo, number } = context.issue;\nconst pr = await github.pulls.get({\n  owner,\n  repo,\n  pull_number: number,\n});\nreturn pr.data.head.repo.html_url+'/archive/refs/heads/'+pr.data.head.ref+'.zip';\n"}},{"name":"Set Module Path","id":"check_module_path","shell":"python","run":"module_file = \"${{ inputs.module-file }}\"\nrepo_link = \"${{steps.get_repo_link.outputs.result}}\"\nif module_file != '-':\n  print ('::set-output name=module-file::{0}'.format(module_file))\nelse:\n  print ('::set-output name=module-file::{0}'.format(repo_link))\n"},{"name":"Execute terraform plan","id":"terraform_plan","if":"${{ steps.format_comment.outputs.command == 'terraform plan' }}","uses":"cloudify-cosmo/terraform-plan-action@v1.3","with":{"environment-name":"${{ inputs.environment-name }}","environment-id":"${{ inputs.environment-id }}","labels":"${{ inputs.labels }}","module-file":"${{steps.check_module_path.outputs.module-file}}","module-source-path":"${{ inputs.module-source-path }}","variables-file":"${{ inputs.variables-file }}","environment-file":"${{ inputs.environment-file }}","environment-mapping":"${{ inputs.environment-mapping }}"}},{"name":"Add plan comment","if":"${{ inputs.github_token != '-' \u0026\u0026 steps.format_comment.outputs.command == 'terraform plan' }}","uses":"actions/github-script@v3","env":{"PLAN":"terraform\n${{ steps.terraform_plan.outputs.terraform-plan }}"},"with":{"github-token":"${{ inputs.github_token }}","script":"const output = `#### Terraform Plan\n\n\u003cdetails\u003e\u003csummary\u003eShow Plan\u003c/summary\u003e\n\n\\`\\`\\`\\n\n${process.env.PLAN}\n\\`\\`\\`\n\n\u003c/details\u003e`;\ngithub.issues.createComment({\n  issue_number: context.issue.number,\n  owner: context.repo.owner,\n  repo: context.repo.repo,\n  body: output\n})\n"}},{"name":"Execute terraform cost","id":"terraform_cost","if":"${{ steps.format_comment.outputs.command == 'terraform cost' }}","uses":"cloudify-cosmo/terraform-cost-action@v1.3","with":{"environment-name":"${{ inputs.environment-name }}","environment-id":"${{ inputs.environment-id }}","labels":"${{ inputs.labels }}","module-file":"${{steps.check_module_path.outputs.module-file}}","module-source-path":"${{ inputs.module-source-path }}","variables-file":"${{ inputs.variables-file }}","environment-file":"${{ inputs.environment-file }}","environment-mapping":"${{ inputs.environment-mapping }}","api-key":"${{ inputs.infracost-api-key }}"}},{"name":"Add cost comment","if":"${{ inputs.github_token != '-' \u0026\u0026 steps.format_comment.outputs.command == 'terraform cost' }}","uses":"actions/github-script@v3","env":{"COST":"terraform\n${{ steps.terraform_cost.outputs.terraform-cost }}"},"with":{"github-token":"${{ inputs.github_token }}","script":"const output = `#### Terraform Cost\n\n\u003cdetails\u003e\u003csummary\u003eShow Cost\u003c/summary\u003e\n\n\\`\\`\\`\\n\n${process.env.COST}\n\\`\\`\\`\n\n\u003c/details\u003e`;\ngithub.issues.createComment({\n  issue_number: context.issue.number,\n  owner: context.repo.owner,\n  repo: context.repo.repo,\n  body: output\n})\n"}},{"name":"Execute terraform apply","id":"terraform_apply","if":"${{ steps.format_comment.outputs.command == 'terraform apply' }}","uses":"cloudify-cosmo/terraform-apply-action@v1.3","with":{"environment-name":"${{ inputs.environment-name }}","environment-id":"${{ inputs.environment-id }}","labels":"${{ inputs.labels }}","module-file":"${{steps.check_module_path.outputs.module-file}}","module-source-path":"${{ inputs.module-source-path }}","variables-file":"${{ inputs.variables-file }}","environment-file":"${{ inputs.environment-file }}","environment-mapping":"${{ inputs.environment-mapping }}"}},{"name":"Add apply comment","if":"${{ inputs.github_token != '-' \u0026\u0026 inputs.skip-apply-comment == 'false' \u0026\u0026 steps.format_comment.outputs.command == 'terraform apply' }}","uses":"actions/github-script@v3","env":{"MODULES":"terraform\n${{ steps.terraform_apply.outputs.terraform-outputs }}"},"with":{"github-token":"${{ inputs.github_token }}","script":"const output = `#### Terraform Modules\n\n\u003cdetails\u003e\u003csummary\u003eShow Modules\u003c/summary\u003e\n\n\\`\\`\\`\\n\n${process.env.MODULES}\n\\`\\`\\`\n\n\u003c/details\u003e`;\ngithub.issues.createComment({\n  issue_number: context.issue.number,\n  owner: context.repo.owner,\n  repo: context.repo.repo,\n  body: output\n})\n"}},{"name":"Execute terraform destroy","id":"terraform_destroy","if":"${{ steps.format_comment.outputs.command == 'terraform destroy' }}","uses":"cloudify-cosmo/terraform-destroy-action@v1.3","with":{"environment-name":"${{ inputs.environment-name }}","environment-id":"${{ inputs.environment-id }}","labels":"${{ inputs.labels }}"}},{"name":"Execute cloudify command from comment","id":"execute_command","if":"${{ !startsWith(steps.format_comment.outputs.command, 'terraform') }}","uses":"cloudify-cosmo/cli-action@v1.3","with":{"command":"${{steps.format_comment.outputs.command}}"}},{"name":"Format command output","id":"format_command","if":"${{ !startsWith(steps.format_comment.outputs.command, 'terraform') }}","shell":"python","run":"cli_output = ${{steps.execute_command.outputs.cli-output}}\ncli_output = cli_output.decode()\ncli_output = cli_output.replace('%','%25')\ncli_output = cli_output.replace('\\n','%0A')\ncli_output = cli_output.replace('\\r','%0D')\nprint ('::set-output name=result::{0}'.format(cli_output))\n"},{"name":"Add comment","if":"${{ inputs.github_token != '-' \u0026\u0026 !startsWith(steps.format_comment.outputs.command, 'terraform') }}","uses":"actions/github-script@v3","env":{"COMMENT":"${{ steps.format_command.outputs.result }}"},"with":{"github-token":"${{ inputs.github_token }}","script":"const output = `#### Command Result\n\n\u003cdetails\u003e\u003csummary\u003eShow Result\u003c/summary\u003e\n\n\\`\\`\\`\\n\n${process.env.COMMENT}\n\\`\\`\\`\n\n\u003c/details\u003e`;\n\ngithub.issues.createComment({\n  issue_number: context.issue.number,\n  owner: context.repo.owner,\n  repo: context.repo.repo,\n  body: output\n})\n"}}]},"default_branch":"master","path":null},"repo_metadata":{"uuid":"471748957","full_name":"cloudify-cosmo/cloudify-comment-action","owner":"cloudify-cosmo","description":null,"archived":false,"fork":false,"pushed_at":"2022-10-05T13:01:32.000Z","size":4,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-07-14T08:43:55.881Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudify-cosmo.png","metadata":{},"created_at":"2022-03-19T16:21:08.000Z","updated_at":"2022-03-19T16:21:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cloudify-cosmo/cloudify-comment-action","commit_stats":null,"previous_names":[],"tags_count":2,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudify-cosmo%2Fcloudify-comment-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudify-cosmo%2Fcloudify-comment-action/tags","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudify-cosmo%2Fcloudify-comment-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudify-cosmo","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":145723034,"owners_count":6280682,"icon_url":"https://github.com/github.png","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"},"owner_record":{"login":"cloudify-cosmo","name":"cloudify-cosmo","uuid":"6260555","kind":"organization","description":"","email":null,"website":"http://cloudify.co","location":null,"twitter":null,"company":null,"icon_url":"https://avatars.githubusercontent.com/u/6260555?v=4","repositories_count":131,"last_synced_at":"2023-03-22T12:36:27.857Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/cloudify-cosmo","created_at":"2022-11-03T08:46:46.611Z","updated_at":"2023-03-22T12:36:28.472Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudify-cosmo","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudify-cosmo/repositories"},"tags":[{"name":"v1.3","sha":"b3b1f8133738ee995f8d7ac6a31cc7ddb59fe80a","kind":"commit","published_at":"2022-10-05T13:01:00.000Z","download_url":"https://codeload.github.com/cloudify-cosmo/cloudify-comment-action/tar.gz/v1.3","html_url":"https://github.com/cloudify-cosmo/cloudify-comment-action/releases/tag/v1.3","dependencies_parsed_at":"2023-06-02T00:46:45.752Z","dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudify-cosmo%2Fcloudify-comment-action/tags/v1.3","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudify-cosmo%2Fcloudify-comment-action/tags/v1.3/manifests"},{"name":"v1.2","sha":"314ea84867d0a9337efd4111cf415d21d3f6bf52","kind":"commit","published_at":"2022-03-21T12:35:13.000Z","download_url":"https://codeload.github.com/cloudify-cosmo/cloudify-comment-action/tar.gz/v1.2","html_url":"https://github.com/cloudify-cosmo/cloudify-comment-action/releases/tag/v1.2","dependencies_parsed_at":"2023-06-02T00:46:45.636Z","dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudify-cosmo%2Fcloudify-comment-action/tags/v1.2","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudify-cosmo%2Fcloudify-comment-action/tags/v1.2/manifests"}]},"repo_metadata_updated_at":"2023-07-14T10:21:29.071Z","dependent_packages_count":0,"downloads":null,"downloads_period":null,"dependent_repos_count":1,"rankings":{"downloads":null,"dependent_repos_count":24.788464585644114,"dependent_packages_count":0.0,"stargazers_count":48.334653779115826,"forks_count":35.1386468071621,"docker_downloads_count":null,"average":27.06544129298051},"purl":"pkg:githubactions/cloudify-cosmo/cloudify-comment-action","advisories":[],"docker_usage_url":"https://docker.ecosyste.ms/usage/actions/cloudify-cosmo/cloudify-comment-action","docker_dependents_count":null,"docker_downloads_count":null,"usage_url":"https://repos.ecosyste.ms/usage/actions/cloudify-cosmo/cloudify-comment-action","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/actions/cloudify-cosmo/cloudify-comment-action/dependencies","status":null,"funding_links":[],"critical":null,"issue_metadata":null,"versions_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/cloudify-cosmo%2Fcloudify-comment-action/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/cloudify-cosmo%2Fcloudify-comment-action/version_numbers","latest_version_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/cloudify-cosmo%2Fcloudify-comment-action/latest_version","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/cloudify-cosmo%2Fcloudify-comment-action/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/cloudify-cosmo%2Fcloudify-comment-action/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/cloudify-cosmo%2Fcloudify-comment-action/codemeta","maintainers":[]}