action-slack-notify
action-slack-notify copied to clipboard
Unable to send notification in macOS
I am trying to send Slack notification when the job is running using macos-latest. Error received is:
##[error]Container action is only supported on Linux
I am aware that Dockerfile is using alpine
distribution. Is there a way we can achieve the same for macos?
Same here, is there a way to enable macOS ?
Same issue
There is a way to make it work on macOS – by not using Docker :) Pure Go action will work on all environments. See https://blog.myitcv.io/2020/02/04/portable-ci-cd-with-pure-go-github-actions.html
Any update?
Any update on this one? Looking to run on macos-latest for github actions.
Any update ?
Any update here too ?
still no update
It does not support mac os but just split your build into two jobs - first run in osx, second in linux based env.
sample from my github CI:
- name: Configure Slack Message # inside job called build, last step..
id: slack_message_config
if: always()
run: |
if [[ "${{ inputs.env_type }}" == "stage" ]]; then
echo "SLACK_USERNAME=BeThink Android Staging | Think" >> $GITHUB_OUTPUT
else
echo "SLACK_USERNAME=BeThink Android Production | Think" >> $GITHUB_OUTPUT
fi
if [[ '${{ job.status }}' == 'success' ]]; then
echo "SLACK_TITLE=Success 🐝" >> $GITHUB_OUTPUT
echo "SLACK_MESSAGE=${{ github.event.head_commit.message }} ${{ steps.apk-output.outputs.apk_url }}" >> $GITHUB_OUTPUT
echo "BUILD_JOB_STATUS=success" >> $GITHUB_OUTPUT
else
echo "SLACK_TITLE=Failed 😿" >> $GITHUB_OUTPUT
echo "SLACK_MESSAGE=${{ github.event.head_commit.message }}" >> $GITHUB_OUTPUT
echo "BUILD_JOB_STATUS=failed" >> $GITHUB_OUTPUT
fi
post-build:
name: post-build
needs: build
if: always()
runs-on: ubuntu-latest
steps:
- name: Slack Build Result Notification
if: always()
env:
SLACK_ICON_URL: ${{ inputs.slack_icon_url }}
SLACK_USERNAME: ${{ steps.slack_message_config.outputs.SLACK_USERNAME }}
SLACK_CHANNEL: ${{ inputs.slack_channel }}
SLACK_COLOR: ${{ needs.build.slack_message_config.outputs.BUILD_JOB_STATUS }}
SLACK_ICON: ${{ inputs.slack_icon_url }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_FOOTER: Think
SLACK_TITLE: ${{ needs.build.slack_message_config.outputs.SLACK_TITLE }}
SLACK_MESSAGE: ${{ needs.build.slack_message_config.outputs.SLACK_MESSAGE }}
uses: rtCamp/action-slack-notify@v2
Thanks for the issue but we don't plan on supporting native MacOS based binary as suggested above by @AlekSi. Instead, please use the containerised action in multiple steps making use of Linux Runner, as suggested by @thefex. And a special thanks to @thefex for providing the answer for this issue!