You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Slack V2 Upload
v1.0.5
This action uploads file(s) to slack using v2 files API.
Required Slack app token. See Internal app tokens
- Create app
- Add
files:write
andfiles:read
permission - Install app to your workspase
- Invite bot to required channels
/invite <botname>
- Use bot token from
OAuth & Permissions
page
Required List of files including file path and filename remember json wont
work with backslashes so you might need ${{ toJSON(variable) }}
Slack channel ID for upload THIS IS NOT A CHANNEL NAME you can easily check for channel ID in the browser URL after navigating to channel there
Slack thread for upload
The message text introducing the file in specified channels.
on: [push]
jobs:
slack_upload_job:
runs-on: ubuntu-latest
name: Upload test file
steps:
- name: Checkout
uses: actions/checkout@v4
- run: |
mkdir dir
echo "Test file " > dir/test.txt
- name: Upload to slack step
uses: vaporif/slack-file-upload-action@v1
with:
token: ${{ secrets.SLACK_TOKEN }}
files: >
[
{"file": "./dir/test.txt", "filename": "testfile.txt"},
{"file": "./dir/test.txt", "filename": "testfile.txt"}
]
channel_id: C06S5FLDSN4