{"id":28628450,"url":"https://github.com/optimizely/upload-custom-code-action","last_synced_at":"2025-06-12T10:33:52.239Z","repository":{"id":54790543,"uuid":"320740957","full_name":"optimizely/upload-custom-code-action","owner":"optimizely","description":"A Github Action that enables Optimizely customers to upload custom JS / CSS to their projects","archived":false,"fork":false,"pushed_at":"2024-12-19T19:32:31.000Z","size":72,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":41,"default_branch":"main","last_synced_at":"2025-06-10T05:18:20.602Z","etag":null,"topics":["optimizely-library","optimizely-owner-cjs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/optimizely.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-12-12T03:40:05.000Z","updated_at":"2025-01-08T16:24:39.000Z","dependencies_parsed_at":"2023-01-04T12:30:42.870Z","dependency_job_id":null,"html_url":"https://github.com/optimizely/upload-custom-code-action","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"3cd94e34f69b4f2b454122e6148c081323e98acf"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/optimizely/upload-custom-code-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optimizely%2Fupload-custom-code-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optimizely%2Fupload-custom-code-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optimizely%2Fupload-custom-code-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optimizely%2Fupload-custom-code-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/optimizely","download_url":"https://codeload.github.com/optimizely/upload-custom-code-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optimizely%2Fupload-custom-code-action/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259447800,"owners_count":22859127,"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":["optimizely-library","optimizely-owner-cjs"],"created_at":"2025-06-12T10:33:47.683Z","updated_at":"2025-06-12T10:33:52.212Z","avatar_url":"https://github.com/optimizely.png","language":"JavaScript","readme":"# upload-custom-code-action\nA Github Action that enables Optimizely customers to upload custom JS / CSS to their Web projects.\n\n#### Table of Contents\n- [Prerequisites](#prerequisites)\n- [Inputs](#inputs)\n- [Outputs](#outputs)\n- [Usage and Examples](#usage-and-examples)\n- [License](#license)\n\n## Prerequisites\n* Set up your Optimizely [Access Token](https://docs.developers.optimizely.com/web/docs/rest-api-getting-started#section-2-generate-a-token)\nas a secret in your repository settings. For the example workflows, use `OPTIMIZELY_API_ACCESS_TOKEN` as the secret name.\n\n* Make sure you have the IDs of the projects, experiments, or variations that you want to update. See the **API Names**\ntab in the sidebar of your experiment for this information.\n\n* Note that at this time, this Github Action only supports A/B tests and Multi-armed Bandit tests in Web Projects.\nPerformance Edge projects, Personalization Campaigns, Multivariate tests are not currently supported.\n\n## Inputs\n\n### `optimizely-access-token`\n**Required** - Your Optimizely access token.\n* The easiest way is to store this as a [repository secret](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets)\nand then pass it in your workflow via `${{secrets.NAME_OF_YOUR_OPTIMIZELY_API_ACCESS_TOKEN_SECRET}}`.\n\n### `code-file-path`\nThe file path to the file containing the code to be uploaded to Optimizely. The file path should start from the root\ndirectory of the repository.\n* The file path **must** be passed in via this input field or through the parameter comment field.\n\n### `custom-code-level`\nThis is the level at which the code is being uploaded to. Choose between `project`, `experiment`, or `variation`.\n* By default, it is set to `variation`.\n\n### `custom-code-type`\nThis is the type of code that is being uploaded. Choose between `custom_code` or `custom_css`.\n* When the `custom-code-level` is `project`, it is assumed that the code type is `custom_code`.\n* By default, it is set to `custom_code`.\n\n### `project-id`\nThis is the ID for the project to upload the code to.\n* Only needed for `project` level code changes.\n\n### `experiment-id`\nThis is the ID of the experiment to upload the code to.\n* Only needed for `experiment` or `variation` level code changes.\n\n### `variation-id`\nThis is the ID of the variation to upload the code to.\n* Only needed for `variation` level code changes.\n\n### `page-id`\nThis is the ID of the page associated with the variation that the code is being uploaded to.\n* Only needed for `variation` level code changes.\n\n### `parameters-comment`\nThis is a string that can be used to pass in all the other parameters *except for `optimizely-access-token` and `fail-silently`*.\n\nExample: `parameters-comment: '--experiment-id=1 --custom-code-path=./code/my_file.js --custom-code-type=custom_code --custom-code-level=experiment'`\n\n### `no-comment`\nIf set to `true`, then no comment will be appended to the end of the code that is uploaded.\n* By default, this is set to `false`.\n\n### `custom-comment`\nA string to be appended as a comment at the end of the code that is uploaded.\n* By default, this is set to \"This code was uploaded via the Optimizely Upload Custom Code Github Action.\"\n\n### `fail-silently`\nWhen set to true, this action will only record errors in logs. It will not fail the entire workflow.\n* By default, this is set to `false`.\n\n## Outputs\n\n### `success`\nThis is set to whether or not the code upload is successful.\n\n### `error_reason`\nIf the code upload is not successful, the error message is set to this value.\n\n## Usage and Examples\nSee the [Examples](https://github.com/optimizely/upload-custom-code-action/tree/main/examples) folder in this repository for example workflows that utilize this action.\n\n## Architecture and Updating\nTo learn more about how this action works and how to update this action, see [Architecture.md](https://github.com/optimizely/upload-custom-code-action/tree/main/Architecture.md).\n\n## License\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptimizely%2Fupload-custom-code-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foptimizely%2Fupload-custom-code-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptimizely%2Fupload-custom-code-action/lists"}