{"id":21070699,"url":"https://github.com/microbit-foundation/action-pr-url-template","last_synced_at":"2025-03-14T02:42:34.554Z","repository":{"id":40773311,"uuid":"258765186","full_name":"microbit-foundation/action-pr-url-template","owner":"microbit-foundation","description":"GitHub Action that comments on opened PRs with a templated URL derived from the branch","archived":false,"fork":false,"pushed_at":"2023-03-04T14:47:30.000Z","size":943,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-17T09:48:32.914Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/microbit-foundation.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}},"created_at":"2020-04-25T12:02:15.000Z","updated_at":"2021-09-21T09:26:39.000Z","dependencies_parsed_at":"2023-02-05T07:46:05.853Z","dependency_job_id":null,"html_url":"https://github.com/microbit-foundation/action-pr-url-template","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microbit-foundation%2Faction-pr-url-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microbit-foundation%2Faction-pr-url-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microbit-foundation%2Faction-pr-url-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microbit-foundation%2Faction-pr-url-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microbit-foundation","download_url":"https://codeload.github.com/microbit-foundation/action-pr-url-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243513795,"owners_count":20303009,"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-19T18:47:52.809Z","updated_at":"2025-03-14T02:42:34.530Z","avatar_url":"https://github.com/microbit-foundation.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![build-test](https://github.com/microbit-foundation/action-pr-url-template/workflows/build-test/badge.svg)\n\n# Comment on a PR when it's opened with a templated URL\n\n## Project status\n\nThe Micro:bit Educational Foundation maintain this for internal use but are not able to commit significant time to extending it beyond our usecase. It's open source in the hope that it will be useful to the GitHub community.\n\n## Introduction\n\nUseful when some other CI system deploys a build to URLs that include the \nbranch name but doesn't integrate with GitHub sufficiently to update the \npull request.\n\nTo use it create a workflow that triggers the action when a PR is opened. For example, create a file at `.github/workflows/pr-url.yml` and specify:\n\n```\nname: \"pr-url\"\non:\n  pull_request:\n    types: [opened]\njobs:\n  pr-url:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: microbit-foundation/action-pr-url-template@v0.1.0\n      with:\n        uri-template: \"http://{branch}.example.com/\"\n        repo-token: ${{ secrets.GITHUB_TOKEN }}\n```\n\nThe `repo-token` line does not need to be modified. It makes the GitHub token available to the action to allow it to comment on the PR via the GitHub API.\n\nThe `uri-template` line should be changed to put the branch name at the correct point in the URL. The template is an [RFC 6570](https://tools.ietf.org/html/rfc6570) URI template.\n\n## Development docs\n\nAs per the [TypeScript action](https://github.com/actions/typescript-action/).\n\n### Code in Master\n\nInstall the dependencies\n\n```bash\n$ npm install\n```\n\nBuild the typescript and package it for distribution\n\n```bash\n$ npm run build \u0026\u0026 npm run pack\n```\n\nRun the tests :heavy_check_mark:\n\n```bash\n$ npm test\n\n PASS  ./index.test.js\n  ✓ throws invalid number (3ms)\n  ✓ wait 500 ms (504ms)\n  ✓ test runs (95ms)\n\n...\n```\n\n### Publish to a distribution branch\n\nActions are run from GitHub repos so we will checkin the packed dist folder.\n\nThen run [ncc](https://github.com/zeit/ncc) and push the results:\n\n```bash\n$ npm run pack\n$ git add dist\n$ git commit -a -m \"prod dependencies\"\n$ git push origin releases/v1\n```\n\nYour action is now published! :rocket:\n\nSee the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)\n\n### Tagging\n\nAfter testing you can [create a v1 tag](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) to reference the stable and latest V1 action\n\n### Code of Conduct\n\nTrust, partnership, simplicity and passion are our core values we live and breathe in our daily work life and within our projects. Our open-source projects are no exception. We have an active community which spans the globe and we welcome and encourage participation and contributions to our projects by everyone. We work to foster a positive, open, inclusive and supportive environment and trust that our community respects the micro:bit code of conduct. Please see our [code of conduct](https://microbit.org/safeguarding/) which outlines our expectations for all those that participate in our community and details on how to report any concerns and what would happen should breaches occur.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrobit-foundation%2Faction-pr-url-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrobit-foundation%2Faction-pr-url-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrobit-foundation%2Faction-pr-url-template/lists"}