{"id":5791855,"name":"dcarbone/tfcloud-module-register-action","ecosystem":"actions","description":"Very quickly made action to register a Terraform Module to a Terraform Cloud Registry","homepage":null,"licenses":"apache-2.0","normalized_licenses":["Apache-2.0"],"repository_url":"https://github.com/dcarbone/tfcloud-module-register-action","keywords_array":[],"namespace":"dcarbone","versions_count":3,"first_release_published_at":"2022-04-01T15:47:36.000Z","latest_release_published_at":"2022-10-18T21:14:21.000Z","latest_release_number":"v0.2.0","last_synced_at":"2026-08-05T12:30:20.876Z","created_at":"2023-01-03T21:47:23.918Z","updated_at":"2026-08-05T12:30:20.877Z","registry_url":"https://github.com/dcarbone/tfcloud-module-register-action","install_command":null,"documentation_url":null,"metadata":{"name":"Register Terraform Cloud Module","description":"Very quickly made action to register a Terraform Module to a Terraform Cloud Registry","branding":{"icon":"archive","color":"purple"},"inputs":{"token":{"required":true,"description":"Terraform Cloud API Token with at least \"Manage Modules\" permissions."},"organization":{"required":true,"description":"Name of Terraform Cloud organization"},"namespace":{"required":true,"description":"Name of Terraform Cloud namespace"},"module-name":{"required":true,"description":"Name of module"},"provider-name":{"required":true,"description":"Name of primary provider used by module"},"registry-name":{"required":true,"default":"private","description":"Terraform Cloud registry name"}},"outputs":{"errors":{"description":"Any error that occurred during registration","value":"${{ steps.register.outputs.errors }}"},"module":{"description":"Module registration JSON","value":"${{ steps.register.outputs.module }}"},"registered":{"description":"If \"true\", this action registered the module","value":"${{ steps.register.outputs.registered }}"}},"runs":{"using":"composite","steps":[{"name":"Ensure jq is installed","uses":"dcarbone/install-jq-action@v1.0.0"},{"name":"Setup","id":"setup","shell":"bash","run":"_base_url='https://app.terraform.io/api/v2/organizations/${{ inputs.organization }}/registry-modules'\n_register_url=\"${_base_url}\"\n_lookup_url=\"${_base_url}/${{ inputs.registry-name }}/${{ inputs.namespace }}/${{ inputs.module-name }}/${{ inputs.provider-name }}\"\n\necho \"base_url=${_base_url}\" \u003e\u003e $GITHUB_OUTPUT\necho \"lookup_url=${_lookup_url}\" \u003e\u003e $GITHUB_OUTPUT\necho \"register_url=${_register_url}\" \u003e\u003e $GITHUB_OUTPUT\n"},{"name":"Register Module","id":"register","shell":"bash","run":"# mask token\necho \"::add-mask::${{ inputs.token }}\"\n\n# default to \"false\" here \necho \"registered=false\" \u003e\u003e $GITHUB_OUTPUT\n\necho \"Determining if module \\\"${{ inputs.module-name }}\\\" is registered...\"\n\n# query for existing module registration\n_lookup_resp=\"$(curl \\\n  -s \\\n  -X GET \\\n  -H 'Content-Type: application/vnd.api+json' \\\n  -H \"Authorization: Bearer ${{ inputs.token }}\" \\\n  \"${{ steps.setup.outputs.lookup_url}}\")\"\n\n_mod_status=\"$(echo -n \"${_lookup_resp}\" | jq -r '.data.attributes.status')\"\n\n# test to see if we can find a module status\n# if so, move on\nif [[ \"${_mod_status}\" != \"null\" ]]; then\n  echo \"Module is already registered, moving on\"\n  echo \"module=${_lookup_resp}\" \u003e\u003e $GITHUB_OUTPUT\n  exit 0\nfi\n\n# at this stage we expect to see a 404\n_errs=\"$(echo -n \"${_lookup_resp}\" | jq -r '.errors')\"\nif [[ \"${_errs}\" == \"null\" ]] || [[ \"$(echo -n \"${_lookup_resp}\" | jq -r '.errors[0].status')\" != \"404\" ]]; then\n  echo \"Expected to see 404, check output \\\"errors\\\" for details\"\n  echo \"errors=${_lookup_resp}\" \u003e\u003e $GITHUB_OUTPUT\n  exit 1\nfi\n\necho \"Module not found in registry, attempting to register...\"\n\n# NOTE: this is most likely where things will fail due to incorrect token permissions\n\n# compile body for register request\n_body=\"{\\\"data\\\":{\\\"type\\\":\\\"registry-modules\\\",\\\"attributes\\\":{\\\"name\\\":\\\"${{ inputs.module-name }}\\\",\\\"provider\\\":\\\"${{ inputs.provider-name }}\\\",\\\"registry-name\\\":\\\"${{ inputs.registry-name }}\\\"}}}\"\n\n# execute register call\n_register_resp=\"$(curl \\\n  -s \\\n  -X POST \\\n  -H 'Content-Type: application/vnd.api+json' \\\n  -H 'Authorization: Bearer ${{ inputs.token }}' \\\n  --data-raw \"${_body}\" \\\n  ${{ steps.setup.outputs.register_url}})\"\n\n# if successful, look for well-known key in response\n_mod_status=\"$(echo -n \"${_register_resp}\" | jq -r '.data.attributes.status')\"\nif [[ \"${_mod_status}\" == \"null\" ]]; then\n  echo \"Error registering module, check \\\"errors\\\" output for details\"\n  echo \"errors=${_register_resp}\" \u003e\u003e $GITHUB_OUTPUT\n  exit 1\nfi\n\n# set register response as \"module\" output\necho \"module=${_register_resp}\" \u003e\u003e $GITHUB_OUTPUT\n\n# flag this action as having registered the module\necho \"registered=true\" \u003e\u003e $GITHUB_OUTPUT\n\necho \"Module successfully registered.\"\n"}]},"default_branch":"main","path":null},"repo_metadata":{"uuid":"476748397","full_name":"dcarbone/tfcloud-module-register-action","owner":"dcarbone","description":"GitHub action you can use to register a module with in Terraform Cloud","archived":false,"fork":false,"pushed_at":"2022-10-18T21:15:14.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-07-13T08:20:25.448Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcarbone.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":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2022-04-01T14:15:07.000Z","updated_at":"2022-04-01T14:15:07.000Z","dependencies_parsed_at":"2023-01-05T04:53:38.405Z","dependency_job_id":null,"html_url":"https://github.com/dcarbone/tfcloud-module-register-action","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.2857142857142857,"last_synced_commit":"370f04c0e93c865fd81275eeb54a96a777e92c1f"},"previous_names":[],"tags_count":3,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarbone%2Ftfcloud-module-register-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarbone%2Ftfcloud-module-register-action/tags","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarbone%2Ftfcloud-module-register-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcarbone","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":145709542,"owners_count":6278958,"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":"dcarbone","name":"Daniel Carbone","uuid":"1392439","kind":"user","description":"i write code.","email":"","website":null,"location":"Nashville, TN","twitter":null,"company":"@turquoisehealth ","icon_url":"https://avatars.githubusercontent.com/u/1392439?v=4","repositories_count":83,"last_synced_at":"2023-04-05T10:37:22.994Z","metadata":{"has_sponsors_listing":true},"html_url":"https://github.com/dcarbone","created_at":"2022-11-04T16:15:50.625Z","updated_at":"2023-04-05T10:37:23.793Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcarbone","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcarbone/repositories"},"tags":[{"name":"v0.2.0","sha":"370f04c0e93c865fd81275eeb54a96a777e92c1f","kind":"commit","published_at":"2022-10-18T21:14:21.000Z","download_url":"https://codeload.github.com/dcarbone/tfcloud-module-register-action/tar.gz/v0.2.0","html_url":"https://github.com/dcarbone/tfcloud-module-register-action/releases/tag/v0.2.0","dependencies_parsed_at":"2023-06-01T12:16:09.728Z","dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarbone%2Ftfcloud-module-register-action/tags/v0.2.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarbone%2Ftfcloud-module-register-action/tags/v0.2.0/manifests"},{"name":"v0.1.1","sha":"013297a6e1a783122ff60b860793994cdb0a426c","kind":"commit","published_at":"2022-04-01T19:02:57.000Z","download_url":"https://codeload.github.com/dcarbone/tfcloud-module-register-action/tar.gz/v0.1.1","html_url":"https://github.com/dcarbone/tfcloud-module-register-action/releases/tag/v0.1.1","dependencies_parsed_at":"2023-06-01T12:16:11.400Z","dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarbone%2Ftfcloud-module-register-action/tags/v0.1.1","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarbone%2Ftfcloud-module-register-action/tags/v0.1.1/manifests"},{"name":"v0.1.0","sha":"9f5032ab49e0c1fb1961e39db8ad93e3f0268857","kind":"commit","published_at":"2022-04-01T15:47:36.000Z","download_url":"https://codeload.github.com/dcarbone/tfcloud-module-register-action/tar.gz/v0.1.0","html_url":"https://github.com/dcarbone/tfcloud-module-register-action/releases/tag/v0.1.0","dependencies_parsed_at":"2023-06-01T12:16:13.524Z","dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarbone%2Ftfcloud-module-register-action/tags/v0.1.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarbone%2Ftfcloud-module-register-action/tags/v0.1.0/manifests"}]},"repo_metadata_updated_at":"2023-07-14T08:49:56.091Z","dependent_packages_count":0,"downloads":null,"downloads_period":null,"dependent_repos_count":0,"rankings":{"downloads":null,"dependent_repos_count":42.858974907023466,"dependent_packages_count":0.0,"stargazers_count":49.38656863164194,"forks_count":37.2590091052879,"average":32.376138160988326},"purl":"pkg:githubactions/dcarbone/tfcloud-module-register-action","advisories":[],"docker_usage_url":"https://docker.ecosyste.ms/usage/actions/dcarbone/tfcloud-module-register-action","docker_dependents_count":null,"docker_downloads_count":null,"usage_url":"https://repos.ecosyste.ms/usage/actions/dcarbone/tfcloud-module-register-action","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/actions/dcarbone/tfcloud-module-register-action/dependencies","status":null,"funding_links":["https://github.com/sponsors/dcarbone"],"critical":null,"issue_metadata":{"last_synced_at":"2023-08-09T08:10:30.681Z","issues_count":0,"pull_requests_count":1,"avg_time_to_close_issue":null,"avg_time_to_close_pull_request":5.0,"issues_closed_count":0,"pull_requests_closed_count":1,"pull_request_authors_count":1,"issue_authors_count":0,"avg_comments_per_issue":null,"avg_comments_per_pull_request":0.0,"merged_pull_requests_count":1,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":0,"past_year_pull_requests_count":1,"past_year_avg_time_to_close_issue":null,"past_year_avg_time_to_close_pull_request":5.0,"past_year_issues_closed_count":0,"past_year_pull_requests_closed_count":1,"past_year_pull_request_authors_count":1,"past_year_issue_authors_count":0,"past_year_avg_comments_per_issue":null,"past_year_avg_comments_per_pull_request":0.0,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":1},"versions_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/dcarbone%2Ftfcloud-module-register-action/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/dcarbone%2Ftfcloud-module-register-action/version_numbers","latest_version_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/dcarbone%2Ftfcloud-module-register-action/latest_version","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/dcarbone%2Ftfcloud-module-register-action/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/dcarbone%2Ftfcloud-module-register-action/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/dcarbone%2Ftfcloud-module-register-action/codemeta","maintainers":[]}