Add support for a `retry` input
Description
Occasionally, we see intermittent errors from the Slack API. They don't seem to be related to our code - the same call attempted multiple times will succeed regularly, only occasionally returning a 500 error.
It would be great if we could configure a retry on this Action.
What type of issue is this? (place an x in one of the [ ])
- [ ] bug
- [x] enhancement (feature request)
- [ ] question
- [ ] documentation related
- [ ] example code related
- [ ] testing related
- [ ] discussion
Requirements (place an x in each of the [ ])
- [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
- [x] I've read and agree to the Code of Conduct.
- [x] I've searched for any related issues and avoided creating a duplicate issue.
+1
👋 Support for a retries input landed in the slackapi/[email protected] with the following options:
0: No retries, just hope that things go alright.5: Five retries in five minutes. Default.10: Ten retries in about thirty minutes.RAPID: A burst of retries to keep things running fast.
- name: Attempt a burst of requests
uses: slackapi/[email protected]
with:
errors: true
method: chat.postMessage
retries: RAPID
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
channel: ${{ secrets.SLACK_CHANNEL_ID }}
text: "status: all things are going good"
I find "rapid" to be quite good for helping handle bursts of requests, but I'd recommend experimenting with these options to find what makes the most sense!
When calling one of the Slack API methods, the @slack/web-api package will attempt automatic retries, while webhooks make use of the axios-retry package. Both of these should handle 429 responses or other unexpected server responses, but please feel free to open another issue if this causes errors for your workflows 🙏