{"id":23070235,"url":"https://github.com/markbattistella/markdown-safe-link-action","last_synced_at":"2025-08-20T14:04:27.653Z","repository":{"id":54827261,"uuid":"328311572","full_name":"markbattistella/markdown-safe-link-action","owner":"markbattistella","description":"Scan your repository for unsafe urls and remove them so you don't get flagged, banned, or spread bad stuff!","archived":false,"fork":false,"pushed_at":"2021-07-13T01:07:03.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-10T18:33:46.745Z","etag":null,"topics":["actions","github-actions","google-safe-browsing","google-safebrowsing","safe-browsing","sanitizer","url-safe"],"latest_commit_sha":null,"homepage":"https://markbattistella.github.io/markdown-safe-link","language":"Shell","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/markbattistella.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null},"funding":{"custom":["https://www.paypal.me/markbattistella/6AUD"]}},"created_at":"2021-01-10T05:36:04.000Z","updated_at":"2024-05-25T11:40:11.000Z","dependencies_parsed_at":"2023-01-11T17:23:18.398Z","dependency_job_id":null,"html_url":"https://github.com/markbattistella/markdown-safe-link-action","commit_stats":{"total_commits":28,"total_committers":2,"mean_commits":14.0,"dds":0.3571428571428571,"last_synced_commit":"800a604703d6e82068476bf9f7d93bb74e595f70"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/markbattistella/markdown-safe-link-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markbattistella%2Fmarkdown-safe-link-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markbattistella%2Fmarkdown-safe-link-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markbattistella%2Fmarkdown-safe-link-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markbattistella%2Fmarkdown-safe-link-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markbattistella","download_url":"https://codeload.github.com/markbattistella/markdown-safe-link-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markbattistella%2Fmarkdown-safe-link-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271330292,"owners_count":24740815,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["actions","github-actions","google-safe-browsing","google-safebrowsing","safe-browsing","sanitizer","url-safe"],"created_at":"2024-12-16T06:25:24.320Z","updated_at":"2025-08-20T14:04:27.624Z","avatar_url":"https://github.com/markbattistella.png","language":"Shell","funding_links":["https://www.paypal.me/markbattistella/6AUD","https://www.buymeacoffee.com/markbattistella"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Markdown URL sanitiser - Github Action\n\n![Markdown URL Sanitiser](https://github.com/markbattistella/markdown-safe-link-action/workflows/Markdown%20URL%20Sanitiser/badge.svg?branch=main)\n\n[![Help donate](https://img.shields.io/badge/%20-@markbattistella-blue?logo=paypal)](https://www.paypal.me/markbattistella/6AUD) [![Buy me a coffee](https://img.shields.io/badge/%20-buymeacoffee-black?logo=buy-me-a-coffee)](https://www.buymeacoffee.com/markbattistella)\n\n---\n\n\u003c/div\u003e\n\nSearch and replace any unsafe urls in your repos using the Google Safe Browsing API\n\n## Background\n\nI started with this tweet by [@seanallen](https://twitter.com/seanallen_dev/status/1332696819625844736) where he added a URL into a YouTube video description.\n\nThe URL became compromised within the week of adding it, and his channel was flagged with **strike 1**.\n\nI realised there isn't anything out there to prevent this from happening to anyone's repository.\n\n## Usage\n\n### Github Action\n\n1. Get an API for [Google Safe Browsing](https://developers.google.com/safe-browsing/)\n\n1. Add the step to your workflow (required minimum):\n\n    ```yaml\n    # You can change this to use a specific version\n    - uses: markbattistella/markdown-safe-links-action@v1\n      with:\n\n        # scope of markdown files (required)\n        directory: \".\"\n\n        # Google Safe Browsing API (required)\n        api: ${{ secrets.GOOGLE_API }}\n\n        # replace malicious urls text (required)\n        replace: \"~~UNSAFE_URL~~\"\n\n        # Github token (required)\n        github_token: ${{ secrets.GITHUB_TOKEN }}\n    ```\n\n## Configuration\n\n| Name               | Value     | Required | Default                       | Description                           |\n|--------------------|-----------|----------|-------------------------------|---------------------------------------|\n| `directory`        | `string`  | Y        | `'.'`                         | Scope of where to scan urls           |\n| `api`              | `string`  | Y        | nil                           | Google API for scanning URLs          |\n| `replace`          | `string`  | Y        | `~~UNSAFE_URL~~`              | What to replace the URLs with         |\n| `github_token`     | `string`  | Y        | `${{ secrets.GITHUB_TOKEN }}` | Token for the repository              |\n| `author_email`     | `string`  |          | Github bot email              | Email for commit                      |\n| `author_name`      | `string`  |          | Github Bot                    | Name for commit                       |\n| `message`          | `string`  |          | Sanitised URLs on DATE        | Message for commit                    |\n| `branch`           | `string`  |          | `main`                        | Destination branch to push changes    |\n| `empty`            | `boolean` |          | `false`                       | Allow empty commits                   |\n| `force`            | `boolean` |          | `false`                       | Determines if force push is used      |\n\n### Examples\n\n#### Normal use\n\n```yaml\nname: Markdown URL Sanitiser\non:\n  [push]\njobs:\n  markdown-safe-link:\n    name: markdown-safe-link\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n      - name: Markdown Safe Link Sanitisation\n        uses: markbattistella/markdown-safe-links-action@v1.0.0\n        id: sanitise\n        with:\n          directory:  \".\"\n          api: ${{ secrets.GOOGLE_API }}\n          replace: \"~~UNSAFE_URL~~\"\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n```\n\n#### Full use\n\n```yaml\nname: Markdown URL Sanitiser\non:\n  [push]\njobs:\n  markdown-safe-link:\n    name: markdown-safe-link\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n      - name: Markdown Safe Link Sanitisation\n        uses: markbattistella/markdown-safe-links-action@v1.0.0\n        id: sanitise\n        with:\n          directory:  \".\"\n          api: ${{ secrets.GOOGLE_API }}\n          replace: \"~~UNSAFE_URL~~\"\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n          author_email: \"my.email@domain.ltd\"\n          author_name: \"My Name\"\n          message: \"Sanitised message - not default\"\n          branch: \"master\" # if your branch hasn't changed to `main`\n          empty: true\n          force: true\n```\n\n#### On CRON schedule\n\nThis is perfect if you want it to scan on an interval if you don't commit frequently.\n\n```yaml\nname: Markdown URL Sanitiser\non:\n  schedule:\n  - cron: \"30 1 * * *\"\njobs:\n  markdown-safe-link:\n    name: markdown-safe-link\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n      - name: Markdown Safe Link Sanitisation\n        uses: markbattistella/markdown-safe-links-action@v1.0.0\n        id: sanitise\n        with:\n          directory:  \".\"\n          api: ${{ secrets.GOOGLE_API }}\n          replace: \"~~UNSAFE_URL~~\"\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n```\n\n#### Locally\n\nYou can use the `node` module from [Github](https://github.com/markbattistella/markdown-safe-link) or from [npm](https://www.npmjs.com/package/@markbattistella/markdown-safe-link).\n\nInstalling it for the command line:\n\n```sh\n# locally\nnpm i @markbattistella/markdown-safe-link\n\n# globally\nnpm i @markbattistella/markdown-safe-link -g\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkbattistella%2Fmarkdown-safe-link-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkbattistella%2Fmarkdown-safe-link-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkbattistella%2Fmarkdown-safe-link-action/lists"}