{"id":15653466,"url":"https://github.com/meilcli/slack-upload-file","last_synced_at":"2026-03-01T11:05:28.467Z","repository":{"id":36969732,"uuid":"280686568","full_name":"MeilCli/slack-upload-file","owner":"MeilCli","description":"upload file to slack action","archived":false,"fork":false,"pushed_at":"2024-10-29T06:53:32.000Z","size":2678,"stargazers_count":32,"open_issues_count":4,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T22:34:06.587Z","etag":null,"topics":["github-actions","slack","slack-api"],"latest_commit_sha":null,"homepage":"https://github.com/MeilCli/actions","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/MeilCli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"MeilCli"}},"created_at":"2020-07-18T15:40:58.000Z","updated_at":"2024-10-24T06:05:58.000Z","dependencies_parsed_at":"2023-02-19T15:30:56.517Z","dependency_job_id":"d7177e18-7345-40e5-8178-f1576e8f0ad7","html_url":"https://github.com/MeilCli/slack-upload-file","commit_stats":{"total_commits":816,"total_committers":6,"mean_commits":136.0,"dds":"0.19485294117647056","last_synced_commit":"f550ac71d59ce095d0df06a48c28b97b677a8530"},"previous_names":[],"tags_count":99,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeilCli%2Fslack-upload-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeilCli%2Fslack-upload-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeilCli%2Fslack-upload-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeilCli%2Fslack-upload-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MeilCli","download_url":"https://codeload.github.com/MeilCli/slack-upload-file/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230423564,"owners_count":18223435,"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","slack-api"],"created_at":"2024-10-03T12:45:45.924Z","updated_at":"2026-01-16T16:13:20.428Z","avatar_url":"https://github.com/MeilCli.png","language":"TypeScript","funding_links":["https://github.com/sponsors/MeilCli"],"categories":[],"sub_categories":[],"readme":"# slack-upload-file\n[![CI-Master](https://github.com/MeilCli/slack-upload-file/actions/workflows/ci-master.yml/badge.svg)](https://github.com/MeilCli/slack-upload-file/actions/workflows/ci-master.yml)  \nupload file to slack action\n\n## Example\n### Post by files\n```yaml\njobs:\n  post:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: MeilCli/slack-upload-file@v4\n        with:\n          slack_token: ${{ secrets.SLACK_TOKEN }}\n          channel_id: ${{ secrets.SLACK_CHANNEL_ID }}\n          file_path: 'docs/*.txt'\n          initial_comment: 'post by slack-upload-file'\n          # thread_ts: 'option'\n```\n\n### Post by workflow yaml\n```yaml\njobs:\n  post:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: MeilCli/slack-upload-file@v4\n        with:\n          slack_token: ${{ secrets.SLACK_TOKEN }}\n          channel_id: ${{ secrets.SLACK_CHANNEL_ID }}\n          content: 'file content'\n          file_type: 'text'\n          file_name: 'text.txt'\n          title: 'title of file'\n          initial_comment: 'post by slack-upload-file'\n          # thread_ts: 'option'\n```\n\n## Information\n- This action execute simply [files.upload](https://api.slack.com/methods/files.upload), and can upload multiple files by [glob pattern](https://github.com/actions/toolkit/tree/main/packages/glob#patterns)\n- How get slack token? see [Basic app setup](https://api.slack.com/authentication/basics)\n- How choose Oauth Scope? This action require `files:read` and `files:write`. In simply case, you do choose `files:read` and `files:write` Bot Token Scope.\n- Why use `files:read` Oauth scope? Because this action use files.uploadv2, and its api requires `files:read`.\n  - ref: https://github.com/slackapi/node-slack-sdk/pull/1544\n- You can also pin to a [specific release](https://github.com/MeilCli/slack-upload-file/releases) version in the format `@v4.x.x`\n\n## Input\n- `slack_token`\n  - required\n  - Slack token, must has files:write permission\n- `slack_api_url`\n  - Custom slack api url\n- `channel_id`\n  - Slack channel id\n- `content`\n  - File contents via a POST variable. If omitting this parameter, you must provide a `file`.\n- `file_path`\n  - File contents via multipart/form-data. If omitting this parameter, you must submit `content`.\n  - You can use [glob pattern](https://github.com/actions/toolkit/tree/main/packages/glob#patterns)\n- `file_path_follow_symbolic_links`\n  - Indicates whether to follow symbolic links\n  - This parameter only use glob pattern\n  - default: true\n- `if_no_files_found`\n  - file not founding options: warn, error or ignore. alike actions/upload-artifact\n  - `warn`: output warning, but do not fail\n  - `ignore`: no output and do not fail\n  - `error`: output warning and do fail\n  - default: error\n- `file_name`\n  - Filename of file.\n  - This parameter can only use providing `content`\n- `file_type`\n  - A file type identifier.\n  - ref: [https://api.slack.com/types/file#file_types](https://api.slack.com/types/file#file_types)\n- `initial_comment`\n  - The message text introducing the file in specified channels.\n  - links might not work because files.uploadv2 limitation. ref: [#695](https://github.com/MeilCli/slack-upload-file/issues/695)\n- `thread_ts`\n  - Provide another message's ts value to upload this file as a reply. Never use a reply's ts value; use its parent instead.\n- `title`\n  - Title of file.\n- `retries`\n  - max API retry count. default retries is 3.\n- `delete_file_ids_before_upload`\n  - file deletion before upload. comma separeted file ids. this argument is purpose for previous uploaded file replacement.\n\n## Output\n- `response`\n  - the api response\n  - json structure: [Summary of response](./docs/response.md)\n- `uploaded_file_ids`\n  - comma separeted uploaded file ids\n\n### Example\n```yaml\njobs:\n  post:\n    runs-on: ubuntu-latest\n    steps:\n      - run: 'echo ${{ github.event.inputs.message }} \u003e message.txt'\n      - uses: MeilCli/slack-upload-file@v4\n        id: message\n        with:\n          slack_token: ${{ secrets.SLACK_TOKEN }}\n          channel_id: ${{ secrets.SLACK_CHANNEL_ID }}\n          file_path: 'message.txt'\n          initial_comment: 'post by slack-upload-file'\n      - run: 'echo ${{ fromJson(steps.message.outputs.response).files[0].file.permalink }}'\n```\n\n## Migration from v2 to v3/v4\n- Must: add `files:read` permission scope to Slack App.\n- Need: change to `channel_id` from `channels`. `channels` is removed because it is deprecated. \n- Some: change some input and output.\n  - input:\n    - new: `delete_file_id_before_upload`, old: `delete_file_id_before_upload`\n    - `title` is changed, it will not send when upload by files.\n  - output:\n    - new: `uploaded_file_ids`, old: `uploaded_file_id`\n    - `response` is changed.\n\n## Contributes\n[\u003cimg src=\"https://gist.github.com/MeilCli/9851a2980ae568e93042315ec2b43588/raw/859ead0ea54e1a8e943b575937bdc0e3c54bf0ac/metrics_contributors.svg\"\u003e](https://github.com/MeilCli/slack-upload-file/graphs/contributors)\n\n### Could you want to contribute?\nsee [Contributing.md](./.github/CONTRIBUTING.md)\n\n## License\n[\u003cimg src=\"https://gist.github.com/MeilCli/9851a2980ae568e93042315ec2b43588/raw/859ead0ea54e1a8e943b575937bdc0e3c54bf0ac/metrics_licenses.svg\"\u003e](LICENSE.txt)\n\n### Using\n- [actions/toolkit](https://github.com/actions/toolkit), published by [MIT License](https://github.com/actions/toolkit/blob/master/LICENSE.md)\n- [slackapi/node-slack-sdk](https://github.com/slackapi/node-slack-sdk), published by [MIT License](https://github.com/slackapi/node-slack-sdk/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeilcli%2Fslack-upload-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeilcli%2Fslack-upload-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeilcli%2Fslack-upload-file/lists"}