title: How to update variable values in html file for sending email in github actions?
body: <p>I am trying to use the action from marketplace at this <a href="https://github.com/juanformoso/action-send-mail" rel="nofollow noreferrer">link</a>.</p>
  <p>It worked and the email is sent, but the variables are not expanded inside it.</p>
  <p>The code snippet:</p>
  <pre><code>  - name: Send Build Email
      # You may pin to the exact commit or the version.
      # uses: juanformoso/action-send-mail@523ea7dd83e339d3c64fc4fdc2da0efc9014ea03
      uses: juanformoso/action-send-mail@1
      with:
        # SMTP server address
        server_address: smtp.sendgrid.net
        # SMTP server port
        server_port: 587
        # Authenticate as this user to SMTP server
        username: apikey
        # Authenticate with this password to SMTP server
        password: ${{secrets.MAIL_PASSWORD}}
        # Subject of mail message
        subject: ${{ github.workflow }} - Build Successful, GitHub_Build:${{ env.git_commit_count }} GitHubWorkflow_Build:${{ github.run_number }}
        # Body of mail message (might be a filename prefixed with file:// to read from)
        body: &quot;file://installs_repo/Projectwise ISM files/${{ env.Version }}/mart_installs_email.html&quot;
        # Recipients mail addresses (separated with comma)
        to: myemail@company.com
        # Email address of the sender
        from: myemail@company.com
        # Content-Type HTTP header (text/html or text/plain)
        content_type: text/html
        # Convert body from Markdown to HTML (set content_type input as text/html too)
        convert_markdown: true
  </code></pre>
  <p>The html file:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;style&gt;
  table {
    font-family: arial, sans-serif;
    border-collapse: collapse;
    width: 100%;
  }
  
  td, th {
    border: 1px solid #dddddd;
    text-align: left;
    padding: 8px;
  }
  
  tr:nth-child(even) {
    background-color: #dddddd;
  }
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;h2&gt;${{ github.workflow }} - Successful&lt;/h2&gt;
  
  &lt;table&gt;
    &lt;tr&gt;
      &lt;td&gt;GitHub Repository&lt;/td&gt;
      &lt;td&gt;${{github.repository}}&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Github Actions Build Number&lt;/td&gt;
      &lt;td&gt;${{ github.run_number }}&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;GitHub Branch Name&lt;/td&gt;
      &lt;td&gt;${{ github.ref_name }}&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Commit Message&lt;/td&gt;
      &lt;td&gt;${{ github.event.head_commit.message }}&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Commit Count or Build Number&lt;/td&gt;
      &lt;td&gt;${{ env.git_commit_count }}&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Daily Builds&lt;/td&gt;
      &lt;td&gt;${{ secrets.DAILY_BUILDS_URL }}&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>And the email I am getting as like this.</p>
  <p><a href="https://i.stack.imgur.com/o1XRP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o1XRP.png" alt="values not expanded" /></a></p>
  <p>How to set the values to expand, even I set the convert_markdown to true but still same issue.</p>
  <p>I am trying to implement that using sed command in the cmd shell, as below.</p>
  <pre><code>  - name: Update HTML file values
      shell: cmd
      run: |
        set html=&quot;.\\installs_repo\\Projectwise ISM files\\${{ env.Version }}\\mart_installs_email.html&quot;
        copy /Y &quot;.\\installs_repo\\Projectwise ISM files\\${{ env.Version }}\\mart_installs_email.template&quot; %html%
        sed -i &quot;s/VAR_REPO/${{github.repository}}/g&quot; %html%
        sed -i &quot;s/VAR_RUNNER/${{ github.run_number }}/g&quot; %html%
        sed -i &quot;s/VAR_REF/${{ github.ref_name }}/g&quot; %html%
        sed -i &quot;s/VAR_COMMIT/${{ github.event.head_commit.message }}/g&quot; %html%
        sed -i &quot;s/VAR_COMMIT_COUNT/${{ env.git_commit_count }}/g&quot; %html%
        sed -i &quot;s/VAR_URL/${{ secrets.DAILY_BUILDS_URL }}/g&quot; %html%
  </code></pre>
  <p>my html file entries changed now.</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;style&gt;
  table {
    font-family: arial, sans-serif;
    border-collapse: collapse;
    width: 100%;
  }
  
  td, th {
    border: 1px solid #dddddd;
    text-align: left;
    padding: 8px;
  }
  
  tr:nth-child(even) {
    background-color: #dddddd;
  }
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;h2&gt;${{ github.workflow }} - Successful&lt;/h2&gt;
  
  &lt;table&gt;
    &lt;tr&gt;
      &lt;td&gt;GitHub Repository&lt;/td&gt;
      &lt;td&gt;VAR_REPO&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Github Actions Build Number&lt;/td&gt;
      &lt;td&gt;VAR_RUNNER&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;GitHub Branch Name&lt;/td&gt;
      &lt;td&gt;VAR_REF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Commit Message&lt;/td&gt;
      &lt;td&gt;VAR_COMMIT&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Commit Count or Build Number&lt;/td&gt;
      &lt;td&gt;VAR_COMMIT_COUNT&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Daily Builds&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;VAR_URL&quot;&gt;OneDrive Link&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>But, getting errors as in screenshot.</p>
  <p><a href="https://i.stack.imgur.com/i8ywu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i8ywu.png" alt="sed error" /></a></p>