{"id":27085344,"url":"https://github.com/carbohydrates/init-action","last_synced_at":"2025-04-06T04:25:56.836Z","repository":{"id":40289010,"uuid":"245170415","full_name":"carbohydrates/init-action","owner":"carbohydrates","description":"This action is used for some automation that should be done once. ","archived":false,"fork":false,"pushed_at":"2023-01-05T09:10:31.000Z","size":1332,"stargazers_count":5,"open_issues_count":16,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-20T20:46:36.400Z","etag":null,"topics":["javascript-action","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/carbohydrates.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-03-05T13:28:35.000Z","updated_at":"2021-04-01T02:13:54.000Z","dependencies_parsed_at":"2023-02-03T22:16:16.484Z","dependency_job_id":null,"html_url":"https://github.com/carbohydrates/init-action","commit_stats":{"total_commits":14,"total_committers":3,"mean_commits":4.666666666666667,"dds":0.3571428571428571,"last_synced_commit":"333cde7f09c242691d7f2af9be4fde95f8695ec5"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carbohydrates%2Finit-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carbohydrates%2Finit-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carbohydrates%2Finit-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carbohydrates%2Finit-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carbohydrates","download_url":"https://codeload.github.com/carbohydrates/init-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247432547,"owners_count":20938174,"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":["javascript-action","typescript"],"created_at":"2025-04-06T04:25:56.244Z","updated_at":"2025-04-06T04:25:56.830Z","avatar_url":"https://github.com/carbohydrates.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Init-action\n\nThis action is used for one time automation after repository creation.\nThis will utilize dispatcher webhook for handling custom event payload.\n\n## Usage\n\nSee [action.yml](action.yml), [init-workflow](.github/workflows/init-workflow.yaml)\n\n```yaml\non: repository_dispatch\njobs:\n  init: # make sure the action works on a clean machine without building\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      - uses: carbohydrates/init-action@v3\n        with:\n          destroy_after_execution: 'false'\n```\n\n## Triggering the action\nThis action is triggered by custom API call https://help.github.com/en/actions/reference/events-that-trigger-workflows#external-events-repository_dispatch.\n\n__Note: This event will only trigger a workflow run if the workflow file is on the master or default branch.__\n\n```yaml\n{\n    \"event_type\": \"init_action\", \n    \"client_payload\": {\n        \"files\": [\"**/*.yaml\"],\n        \"ignores\": [],\n        \"toReplace\": {\n            \"__PLACEHOLDER1__\": \"someValue1\",\n            \"__PLACEHOLDER2__\": \"someValue2\",\n            \"_placeholder1__\" : \"yaaaay\"\n        }\n    }\n}\n```\n\n| Name                     | Type                    | description                                                                                      |\n|--------------------------|-------------------------|--------------------------------------------------------------------------------------------------|\n| event_type               | `string`                  | Required: A custom webhook event name.                                                           |\n| client_payload           | `object`                  | JSON payload with extra information about the webhook event that your action or worklow may use. |\n| client_payload.files     | `string[]`                | Array of the file patterns that should be used for processing                                    |\n| client_payload.ignores   | `string[]`                | Array of the file patterns that should be excluded from processing                               |\n| client_payload.toReplace | `{[key: string]: string}` | Map of k,v where k replacing placeholder and v is value for this replacement  \n\n\n```bash\ncurl --request POST \\\n  --url https://api.github.com/repos/carbohydrates/init-action/dispatches \\\n  --header 'cache-control: no-cache' \\\n  --header 'content-type: application/json' \\\n  --data '{\"event_type\":\"init_action\",\"client_payload\":{\"files\":[\"**/*.yaml\"],\"ignores\":[],\"toReplace\":{\"__PLACEHOLDER1__\":\"someValue1\",\"__PLACEHOLDER2__\":\"someValue2\",\"_placeholder1__\":\"yaaaay\"}}}'\n```\n\n*NOTE:* For private repos you should use Basic Auth with private access token\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarbohydrates%2Finit-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarbohydrates%2Finit-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarbohydrates%2Finit-action/lists"}