[slack] Enable emoji-based icons in Slack action by adding icon_emoji parameter #22235
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validci/circleci
builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)Motivation and Context
This update is needed to make the Slack action in Fastlane more flexible by adding support for using emojis as icons in Slack messages. Right now, you can only use image URLs for the icon, even though Slack’s API lets you use emojis too. This change allows users to customize their notifications a bit more by adding emoji icons, which can make messages more fun or visually informative 🤖 🏄
Description
I added a new parameter to the Slack action in Fastlane, allowing users to specify an emoji as the message icon. The new parameter integrates with Slack’s existing API capabilities for setting an emoji as the avatar/icon of a message, offering more customization.
In addition to the new feature, I ensured that the previous functionality, which supports image URLs for the icon, remains unaffected (no breaking changes).
The changes have been tested locally by running the Fastlane Slack action with both emoji and image-based icons. I’ve validated that the correct message format is sent to Slack in each case (see the next section).
Testing Steps
I tested this branch locally using the Slack action with these scenarios:
I’ve attached the testing lane I used and a screenshot below to show the results for each scenario:
Code
Result of the previous code: