action-slack-notify icon indicating copy to clipboard operation
action-slack-notify copied to clipboard

Unable to send notification in macOS

Open varunnayal opened this issue 4 years ago • 6 comments

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?

varunnayal avatar Mar 26 '20 19:03 varunnayal

Same here, is there a way to enable macOS ?

ycocatrix avatar Oct 28 '20 09:10 ycocatrix

Same issue

MatanVal avatar Nov 03 '20 12:11 MatanVal

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

AlekSi avatar Dec 03 '20 15:12 AlekSi

Any update?

minhchienwikipedia avatar Nov 30 '21 06:11 minhchienwikipedia

Any update on this one? Looking to run on macos-latest for github actions.

cjfowlie avatar Sep 01 '22 05:09 cjfowlie

Any update ?

jrdaher avatar Sep 06 '22 20:09 jrdaher

Any update here too ?

kopax-polyconseil avatar Dec 22 '22 11:12 kopax-polyconseil

still no update

aliasheer123 avatar Feb 22 '23 14:02 aliasheer123

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

thefex avatar Jul 12 '23 13:07 thefex

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!

L0RD-ZER0 avatar Mar 11 '24 13:03 L0RD-ZER0