{"id":17317790,"url":"https://github.com/ken-matsui/slack-cleaner","last_synced_at":"2026-05-11T06:02:18.489Z","repository":{"id":65160460,"uuid":"226930733","full_name":"ken-matsui/slack-cleaner","owner":"ken-matsui","description":"slack-cleaner for GitHub Actions","archived":false,"fork":false,"pushed_at":"2021-09-04T02:52:21.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-02T04:41:19.495Z","etag":null,"topics":["github-actions","slack"],"latest_commit_sha":null,"homepage":"","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/ken-matsui.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":"2019-12-09T17:38:09.000Z","updated_at":"2022-08-19T22:09:30.000Z","dependencies_parsed_at":"2023-01-13T15:43:55.902Z","dependency_job_id":null,"html_url":"https://github.com/ken-matsui/slack-cleaner","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.1428571428571429,"last_synced_commit":"3919a85b0048e0d1b62d66b59cb5f528dcc8c753"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":"actions/container-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ken-matsui%2Fslack-cleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ken-matsui%2Fslack-cleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ken-matsui%2Fslack-cleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ken-matsui%2Fslack-cleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ken-matsui","download_url":"https://codeload.github.com/ken-matsui/slack-cleaner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245767360,"owners_count":20668827,"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":["github-actions","slack"],"created_at":"2024-10-15T13:17:49.071Z","updated_at":"2026-05-11T06:02:18.313Z","avatar_url":"https://github.com/ken-matsui.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slack-cleaner\n\nThis action is [kfei/slack-cleaner](https://github.com/kfei/slack-cleaner) for GitHub Actions.\n\nGenerated from [actions/container-action](https://github.com/actions/container-action) template.\n\n## Usage\n\nHere is an example workflow setting of this action.\n\n1. Create a `.github/workflows/slack-cleaner.yml` file in your GitHub repository you want setup.\n\n2. Add the following code to the `slack-cleaner.yml` file.\n\n```yml\n# .github/workflows/slack-cleaner.yml\n\nname: Slack Cleaner\non:\n  schedule:\n    - cron:  '0 0 1 * *'\njobs:\n  clean:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: ken-matsui/slack-cleaner@v1\n        with:\n          token: ${{ secrets.SLACK_LEGACY_TOKEN }}\n          message: true\n          channel: 'general'\n          user: '*'\n          before: '20191201'\n          perform: true\n```\n\n## Input parameters\n\nThe only required parameter is `token`.\nIt should be a Slack legacy token, and you can get it from https://api.slack.com/custom-integrations/legacy-tokens.\n\nIt should start with `xoxp`, not like bot token with `xoxb`.\n\nAnd you need to set it to your GitHub repository secrets. \n\nPlease refer https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets to know how to do that and for more details.\n\n| Parameter Name | Required  | Default  | Description |\n|:--------------:|:---------:|:--------:|:------------|\n| token          | ○         | N/A      | Slack API legacy token |\n| rate           | ×         | N/A      | Delay between API calls (in seconds) |\n| message        | ×         | false    | Delete messages |\n| file           | ×         | false    | Delete files |\n| channel        | ×         | N/A      | Channel name's, e.g., general |\n| direct         | ×         | N/A      | Direct message's name, e.g., sherry |\n| group          | ×         | N/A      | Private group's name |\n| mpdirect       | ×         | N/A      | Multiparty direct message's name, e.g., sherry,james,johndoe |\n| user           | ×         | N/A      | Delete messages/files from certain user |\n| bot            | ×         | false    | Delete messages from bots |\n| after          | ×         | N/A      | Delete messages/files newer than this time (YYYYMMDD) |\n| before         | ×         | N/A      | Delete messages/files older than this time (YYYYMMDD) |\n| types          | ×         | N/A      | Delete files of a certain type, e.g., posts,pdfs |\n| perform        | ×         | false    | Perform the task |\n\n## Examples\n\n### Progammatic Parameter\n\n\u003cdetails\u003e\u003csummary\u003eExpand to see an example workflow\u003c/summary\u003e\u003cdiv\u003e\n\n```yml\n# .github/workflows/slack-cleaner.yml\n\nname: Slack Cleaner\non:\n  schedule:\n    - cron:  '0 0 1 * *'\njobs:\n  clean:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Get datetime\n        id: datetime\n        run: echo \"::set-output name=value::$(date -d '-5 days' '+%Y%m%d')\"\n      - uses: ken-matsui/slack-cleaner@v1\n        with:\n          token: ${{ secrets.SLACK_LEGACY_TOKEN }}\n          rate: '1'\n          message: true\n          channel: 'notifications'\n          user: '*'\n          before: ${{ steps.datetime.outputs.value }}\n          perform: true\n```\n\u003c/div\u003e\u003c/details\u003e\n\n### Delete all messages from a channel\n\n\u003cdetails\u003e\u003csummary\u003eExpand to see an example workflow\u003c/summary\u003e\u003cdiv\u003e\n\n```yml\n# .github/workflows/slack-cleaner.yml\n\nname: Slack Cleaner\non: push\njobs:\n  clean:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: ken-matsui/slack-cleaner@v1\n        with:\n          token: ${{ secrets.SLACK_LEGACY_TOKEN }}\n          message: true\n          channel: 'general'\n          user: '*'\n          perform: true\n```\n\u003c/div\u003e\u003c/details\u003e\n\n### Delete all messages from a private group\n\n\u003cdetails\u003e\u003csummary\u003eExpand to see an example workflow\u003c/summary\u003e\u003cdiv\u003e\n\n```yml\n# .github/workflows/slack-cleaner.yml\n\nname: Slack Cleaner\non: push\njobs:\n  clean:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: ken-matsui/slack-cleaner@v1\n        with:\n          token: ${{ secrets.SLACK_LEGACY_TOKEN }}\n          message: true\n          group: 'hr'\n          user: '*'\n          perform: true\n```\n\u003c/div\u003e\u003c/details\u003e\n\n### Delete all messages from a direct message channel\n\n\u003cdetails\u003e\u003csummary\u003eExpand to see an example workflow\u003c/summary\u003e\u003cdiv\u003e\n\n```yml\n# .github/workflows/slack-cleaner.yml\n\nname: Slack Cleaner\non: push\njobs:\n  clean:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: ken-matsui/slack-cleaner@v1\n        with:\n          token: ${{ secrets.SLACK_LEGACY_TOKEN }}\n          message: true\n          direct: 'sherry'\n          user: 'johndoe'\n          perform: true\n```\n\u003c/div\u003e\u003c/details\u003e\n\n### Delete all messages from a multiparty direct message channel\n\n\u003cdetails\u003e\u003csummary\u003eExpand to see an example workflow\u003c/summary\u003e\u003cdiv\u003e\n\n**Note: that the list of usernames must contains yourself.**\n\n```yml\n# .github/workflows/slack-cleaner.yml\n\nname: Slack Cleaner\non: push\njobs:\n  clean:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: ken-matsui/slack-cleaner@v1\n        with:\n          token: ${{ secrets.SLACK_LEGACY_TOKEN }}\n          message: true\n          mpdirect: 'sherry,james,johndoe'\n          user: '*'\n          perform: true\n```\n\u003c/div\u003e\u003c/details\u003e\n\n### Delete all messages from certain user\n\n\u003cdetails\u003e\u003csummary\u003eExpand to see an example workflow\u003c/summary\u003e\u003cdiv\u003e\n\n```yml\n# .github/workflows/slack-cleaner.yml\n\nname: Slack Cleaner\non: push\njobs:\n  clean:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: ken-matsui/slack-cleaner@v1\n        with:\n          token: ${{ secrets.SLACK_LEGACY_TOKEN }}\n          message: true\n          channel: 'gossip'\n          user: 'johndoe'\n          perform: true\n```\n\u003c/div\u003e\u003c/details\u003e\n\n### Delete all messages from bots (especially flooding CI updates)\n\n\u003cdetails\u003e\u003csummary\u003eExpand to see an example workflow\u003c/summary\u003e\u003cdiv\u003e\n\n```yml\n# .github/workflows/slack-cleaner.yml\n\nname: Slack Cleaner\non: push\njobs:\n  clean:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: ken-matsui/slack-cleaner@v1\n        with:\n          token: ${{ secrets.SLACK_LEGACY_TOKEN }}\n          message: true\n          channel: 'auto-build'\n          bot: true\n          perform: true\n```\n\u003c/div\u003e\u003c/details\u003e\n\n### Delete all messages older than 2015/09/19\n\n\u003cdetails\u003e\u003csummary\u003eExpand to see an example workflow\u003c/summary\u003e\u003cdiv\u003e\n\n```yml\n# .github/workflows/slack-cleaner.yml\n\nname: Slack Cleaner\non: push\njobs:\n  clean:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: ken-matsui/slack-cleaner@v1\n        with:\n          token: ${{ secrets.SLACK_LEGACY_TOKEN }}\n          message: true\n          channel: 'general'\n          user: '*'\n          before: '20150919'\n          perform: true\n```\n\u003c/div\u003e\u003c/details\u003e\n\n### Delete all files\n\n\u003cdetails\u003e\u003csummary\u003eExpand to see an example workflow\u003c/summary\u003e\u003cdiv\u003e\n\n```yml\n# .github/workflows/slack-cleaner.yml\n\nname: Slack Cleaner\non: push\njobs:\n  clean:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: ken-matsui/slack-cleaner@v1\n        with:\n          token: ${{ secrets.SLACK_LEGACY_TOKEN }}\n          file: true\n          user: '*'\n          perform: true\n```\n\u003c/div\u003e\u003c/details\u003e\n\n### Delete all files from certain user\n\n\u003cdetails\u003e\u003csummary\u003eExpand to see an example workflow\u003c/summary\u003e\u003cdiv\u003e\n\n```yml\n# .github/workflows/slack-cleaner.yml\n\nname: Slack Cleaner\non: push\njobs:\n  clean:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: ken-matsui/slack-cleaner@v1\n        with:\n          token: ${{ secrets.SLACK_LEGACY_TOKEN }}\n          file: true\n          user: 'johndoe'\n          perform: true\n```\n\u003c/div\u003e\u003c/details\u003e\n\n### Delete all snippets and images\n\n\u003cdetails\u003e\u003csummary\u003eExpand to see an example workflow\u003c/summary\u003e\u003cdiv\u003e\n\n```yml\n# .github/workflows/slack-cleaner.yml\n\nname: Slack Cleaner\non: push\njobs:\n  clean:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: ken-matsui/slack-cleaner@v1\n        with:\n          token: ${{ secrets.SLACK_LEGACY_TOKEN }}\n          file: true\n          types: 'snippets,images'\n          perform: true\n```\n\u003c/div\u003e\u003c/details\u003e\n\n## LICENSE\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fken-matsui%2Fslack-cleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fken-matsui%2Fslack-cleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fken-matsui%2Fslack-cleaner/lists"}