dawidd6 / action-send-mail

:gear: A GitHub Action to send an email to multiple recipients
MIT License
435 stars 185 forks source link

The mail is sent without the attachement #166

Open Nawi98 opened 1 year ago

Nawi98 commented 1 year ago

Hello everyone ! The final aim of my worflow is to sent my artifact by mail : Here is my workflow :

to_github

``

The mail is sent correctly but I do not see any attachment in it :

mail_sent

Any thought about it please? Regards.

dawidd6 commented 1 year ago

Is this windows runner? I haven't tested this action on windows at all.

Nawi98 commented 1 year ago

Hello @dawidd6 , I made some changes in my code, here it is now :

on: workflow_dispatch 

jobs:
  run_manual : # run my test
    runs-on: ubuntu-latest
    steps:
      - name: run the Testim s tests with Testim s gitHub action
        #id: tests_ok_ko
        uses: instinctstudios/testim-cli-gh-action@v0.6.0
        continue-on-error: true
        with:
          token: ${{ secrets.TESTIM_TOKEN }} 
          project: ${{ secrets.PROJECT_ID }} 
          grid: Testim-Grid
          suite: to_test_github_integration

      - name: upload the artifact generated by Testim itself
        uses: actions/upload-artifact@v3
        with:
          name: test_report
          path: /home/runner/work/launch_testim_tests/launch_testim_tests/testim-report.xml
          if-no-files-found: warn

      - name: parse the file
        run: cat /home/runner/work/launch_testim_tests/launch_testim_tests/testim-report.xml | grep -i -C 1 "<failure" | tee final-report.xml

      - name: Zip file
        uses: montudor/action-zip@v1
        with:
          args: zip -qq -r testim-report.zip . -i /home/runner/work/launch_testim_tests/launch_testim_tests/testim-report.xml

      #- name: Find the file
      #  run: find -name ./testim-report.zip -print

      - name: Find the file
        run: find ${{ github.workspace }} -name 'testim-report.zip' -print

      - name: Upload artifact
        uses: actions/upload-artifact@v2
        with:
          name: my-zip-artifact
          path: /home/runner/work/launch_testim_tests/launch_testim_tests/testim-report.zip

      - name: Checkout code
        uses: actions/checkout@v2

      - name: Send Email
        uses: dawidd6/action-send-mail@v3
        with:
          server_address: ${{ secrets.SMTP_SERVER }}
          server_port: ${{ secrets.SMTP_PORT }}
          secure: true
          username: ${{ secrets.MAIL }}
          password: ${{ secrets.PASSWORD }}
          subject: "XML File"
          to: myMail@gmail.com
          from: Testim User
          body: Please find the report of Testim tests attached.
          attachments: /home/runner/work/launch_testim_tests/launch_testim_tests/testim-report.zip

But unfortunately, the file is not received .