Skip to content

feat: include an 'api' option to customize the slack api method url #409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 14, 2025

Conversation

zimeg
Copy link
Member

@zimeg zimeg commented Mar 12, 2025

Summary

This PR introduces an api option to the inputs of this action as a "custom API URL to send Slack API method requests to".

Resolves #389.

Preview

  - name: Send to a custom API URL
    uses: slackapi/slack-github-action@v2.0.0
    with:
+     api: http://localhost:8080
      method: chat.postMessage
      token: ${{ secrets.SLACK_BOT_TOKEN }}
      payload: |
        channel: ${{ secrets.SLACK_CHANNEL_ID }}
        text: "What's happening on localhost?"

Notes

Changes in this PR also include refactors of #408 needed for testing 🙏 ✨

Super open to naming suggestions since "api" might not be so clear right away, but IMO it matches "method" well 🤔

Requirements

@zimeg zimeg added enhancement New feature or request semver:minor labels Mar 12, 2025
@zimeg zimeg added this to the 2.1 milestone Mar 12, 2025
@zimeg zimeg self-assigned this Mar 12, 2025
Copy link

codecov bot commented Mar 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.85%. Comparing base (21be76f) to head (2b91f3c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #409   +/-   ##
=======================================
  Coverage   99.85%   99.85%           
=======================================
  Files           7        7           
  Lines         699      702    +3     
=======================================
+ Hits          698      701    +3     
  Misses          1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@WilliamBergamin WilliamBergamin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zimeg
Copy link
Member Author

zimeg commented Mar 14, 2025

@WilliamBergamin Thank you for the review! 🙏 ✨

I've confirmed the api option can be used to send requests to development setups, so will go ahead and merge this now 🚢 💨

@zimeg zimeg merged commit f841ea5 into slackapi:main Mar 14, 2025
5 checks passed
@zimeg zimeg mentioned this pull request Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request semver:minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

please expose slackApiUrl
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy