{"id":18282942,"url":"https://github.com/zentered/cloudflare-preview-url","last_synced_at":"2025-08-31T20:40:17.677Z","repository":{"id":38846336,"uuid":"383057580","full_name":"zentered/cloudflare-preview-url","owner":"zentered","description":"GitHub Action to return the Cloudflare Pages Preview URL","archived":false,"fork":false,"pushed_at":"2024-06-23T15:54:54.000Z","size":1279,"stargazers_count":11,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T23:05:58.500Z","etag":null,"topics":[],"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/zentered.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-05T07:47:59.000Z","updated_at":"2024-07-16T08:57:48.000Z","dependencies_parsed_at":"2023-02-18T00:01:41.419Z","dependency_job_id":"923d907b-d8fb-4e01-95f8-80440bb8447b","html_url":"https://github.com/zentered/cloudflare-preview-url","commit_stats":{"total_commits":63,"total_committers":5,"mean_commits":12.6,"dds":0.4920634920634921,"last_synced_commit":"ff600e0a1355bab7fed9d1c97a4243edfecc29b0"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zentered%2Fcloudflare-preview-url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zentered%2Fcloudflare-preview-url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zentered%2Fcloudflare-preview-url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zentered%2Fcloudflare-preview-url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zentered","download_url":"https://codeload.github.com/zentered/cloudflare-preview-url/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299766,"owners_count":20916183,"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":[],"created_at":"2024-11-05T13:06:46.767Z","updated_at":"2025-04-05T06:30:49.173Z","avatar_url":"https://github.com/zentered.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloudflare Preview URL\n\n![Test](https://github.com/zentered/cloudflare-preview-url/workflows/Test/badge.svg)\n![Release](https://github.com/zentered/cloudflare-preview-url/workflows/Publish/badge.svg)\n[![semantic-release: conventional](https://img.shields.io/badge/semantic--release-conventional-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n\nRetrieve the preview/deployment URL from the Cloudflare API, filtered by the\nrepository and branch. The URL can then be used for further end-to-end tests,\nlink checks and other PR integrations/actions.\n\n## Usage\n\n### API Token (recommended)\n\nNavigate to the\n[Cloudflare API Tokens](https://dash.cloudflare.com/profile/api-tokens) page and\ncreate a new token with the following permissions:\n\n- Account - Cloudflare Pages - Read\n- Include - [your page]\n\nCopy the token and add it to your repository secrets as `CLOUDFLARE_API_TOKEN`.\n\n### Global API Key\n\n[Copy your \"Global API Key\"](https://dash.cloudflare.com/profile/api-tokens) -\nthis also requires the Account Email to be set.\n\n### Workflow template\n\n```yaml\non:\n  push:\n    branches:\n      - '**'\n      - '!main'\n# Add a sleep action to wait until the deployment is ready\n- run: sleep 30\n- name: cloudflare-preview-url\n# Use the latest version\n  uses: zentered/cloudflare-preview-url@v1.4.2\n  id: cloudflare_preview_url\n  env:\n    CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}\n    CLOUDFLARE_ACCOUNT_EMAIL: ${{ secrets.CLOUDFLARE_ACCOUNT_EMAIL }}\n    CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}\n  with:\n    cloudflare_project_id: 'repo-name'\n    wait_until_ready: true\n- name: Get URL\n  run: echo \"https://${{ steps.cloudflare_preview_url.outputs.preview_url }}\"\n```\n\nWe recommend setting a timeout for this action, if something goes wrong with the\nbuild, the Action should stop after 10 minutes:\n\n```yaml\nruns-on: ubuntu-latest\ntimeout-minutes: 10\n```\n\n## Environment Variables / Secrets\n\nIn the repository, go to \"Settings\", then \"Secrets\" and add\n`CLOUDFLARE_API_TOKEN`, the value you can retrieve on your\n[Cloudflare account](https://dash.cloudflare.com/profile/api-tokens). You also\nneed to add:\n\n- `CLOUDFLARE_ACCOUNT_ID` (from the URL:\n  `https://dash.cloudflare.com/123abc....`)\n- [optional] `CLOUDFLARE_ACCOUNT_EMAIL` (your login email)\n\nWhen providing an account email address, the token will not be used as `Bearer`\ntoken.\n\n## Inputs\n\n| Name                    | Requirement | Description                                                                                                                     |\n| ----------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| `cloudflare_project_id` | required    | Cloudflare project id/name                                                                                                      |\n| `wait_until_ready`      | optional    | Wait until the Cloudflare deployment is ready, defaults to \"false\"                                                              |\n| `environment`           | optional    | Which Cloudflare deployment environments to allow. If set to null, doesn't filter deploys by environment. Defaults to \"preview\" |\n| `commit_hash`           | optional    | Optional commit hash to filter deployments on. Useful when the same branch can have multiple deploys.                           |\n| `branch`                | optional    | Optional branch name to filter deployments on. Useful when the branch name is not available in the action context.              |\n\n## Outputs\n\n| Name          | Description                                                                                                             |\n| ------------- | ----------------------------------------------------------------------------------------------------------------------- |\n| `preview_url` | A string with the unique URL of the deployment. If it hasn't finished uploading (is incomplete), the value will be null |\n\n## Contributing\n\nSee [CONTRIBUTING](CONTRIBUTING.md).\n\n## License\n\nSee [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzentered%2Fcloudflare-preview-url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzentered%2Fcloudflare-preview-url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzentered%2Fcloudflare-preview-url/lists"}