action-discord icon indicating copy to clipboard operation
action-discord copied to clipboard

FYI: Container actions only work on linux builds

Open rjstone opened this issue 4 years ago • 6 comments

Doesn't work for windows builds. Might want to mention in docs.

rjstone avatar Nov 21 '19 05:11 rjstone

what is work for my builds ?this is my personal subject .plese don't distrib me.-:)

Rkbhasan1 avatar Dec 18 '19 23:12 Rkbhasan1

yes.

IBM.Com

On Thu, Dec 19, 2019, 5:42 AM Rkb hasan [email protected] wrote:

what is work for my builds ?this is my personal subject .plese don't distrib me.-:)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Ilshidur/action-discord/issues/11?email_source=notifications&email_token=ALDTO5WSW3D3P3X5OTMF3XTQZKYPRA5CNFSM4JP5J5V2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHH324I#issuecomment-567262577, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALDTO5XCWA553RD72GX25NTQZKYPRANCNFSM4JP5J5VQ .

Rkbhasan1 avatar Dec 18 '19 23:12 Rkbhasan1

Hello. Sorry for the late response. I finally have some free time to check this issue. Thanks for your patience.

Ilshidur avatar Dec 19 '19 13:12 Ilshidur

Confirming this is still an issue I am getting the error on the following builds.

Run Ilshidur/action-discord@cc38eb40798e4aafd43ae51e8dd3e507dc57234e
##[error]Container action is only supported on Linux

rosman21 avatar Apr 12 '20 14:04 rosman21

Hello. Sorry, I totally forgot about this issue.

Apparently, containerized Actions can only runs on Linux environments according to this doc : https://help.github.com/en/actions/building-actions/about-actions#types-of-actions

I can't find any proper way to make it compatible, except to migrate it to a pure Javascript Action, which would make it a breaking change.

For now, if you use a GitHub-hosted runner, I recommend to use the ubuntu-18.04 environment :

jobs:
  build:
    runs-on: ubuntu-18.04
    steps:
      - name: Discord notification
      env:
        DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
      uses: Ilshidur/action-discord@master
      with:
        args: 'The project {{ EVENT_PAYLOAD.repository.full_name }} has been deployed.'

Sorry to answer this issue after so long ... only to provide so little help.

If someone has a workaround for this, I would be glad to document this or apply a fix. I admit that this can be a pain. Let's hope that GitHub has planned some solutions in the near future 🤞 .

Ilshidur avatar Apr 13 '20 13:04 Ilshidur

I'm commenting here because someone surely, someday, will come back again and wonder how to do it on windows.

      - name: notify
        env:
          DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
        run: |
          $MESSAGE=@"
          {\"content\": \"Cool message"}
          "@
          C:\msys64\usr\bin\curl.exe -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST $env:DISCORD_WEBHOOK --data $MESSAGE

There you go, no dependencies needed, not even this action. just a simple curl request. Have fun!

ldd avatar Nov 20 '20 21:11 ldd