test-with-actions icon indicating copy to clipboard operation
test-with-actions copied to clipboard

[Bug] Step "Run markdown lint" ends with en error

Open ricardojfc opened this issue 9 months ago • 5 comments

Summary

Step "Run markdown lint" ends with en error and the README.md isn't updated

How to reproduce

  1. Open a new browser tab, and work on the steps in your second tab while you read the instructions in this tab

  2. Go to the Actions tab.

  3. Click New workflow.

  4. Search for "Simple workflow" and click Configure.

  5. Name your workflow ci.yml.

  6. Update the workflow to remove all steps other than the "checkout" step.

  7. Add the following step to your workflow:

    - name: Run markdown lint
      run: |
        npm install remark-cli remark-preset-lint-consistent
        npx remark . --use remark-preset-lint-consistent --frail
    

    Even after the code is indented properly in ci.yml, you will see a build error in GitHub Actions. We'll fix this in the next step.

  8. Click Start commit, and choose to make a new branch named ci.

  9. Click Propose a new file.

  10. Click Create pull request.

  11. Wait about 20 seconds then refresh this page (the one you're following instructions from). GitHub Actions will automatically update to the next step.

Image

ricardojfc avatar Oct 02 '23 14:10 ricardojfc

the task: "Update the code in the ci branch to get the test to pass." Clue: on line 18 there is a file. the issue has something to do with markdown syntax. i personally asked chat gpt, and thats how i reached to the solution after a long time.. good luck!

Gabor12321 avatar Nov 04 '23 18:11 Gabor12321

The following line is causing the warning and error

npx remark . --use remark-preset-lint-consistent --frail

The "." is asking to check all files for markdown syntax and its warning that "resume.md" is not following the syntax.

You can use "" or "*" to markdown as italics font. However when you use "consisent" as in the code above, then you should only use either "" or "" throughout the file. "resume.md" started using "_" and then later it also used "", hence the warning. (ref:https://www.npmjs.com/package/remark-lint-emphasis-marker/v/3.1.0)

The "--frail" will exits as failed when there is a warnings. (ref: Search for "--frail" in the URL:https://github.com/remarkjs/remark-lint)

In short if you where to replace *Git* with _Git_ in the "resume.md" then you will not have any errors.

But then we don't get to do the LAB as per the instructions provided.

Also the error Screenshots mentioned in Step2 - "Review required" and "Merging is blocked" never occurs, as there were no Branch rules already to cause this error.

If at the beginning of the Step1, we add a step to create a branch rule requiring one reviewer approval then we get this error when attempting to perform the pull request after creating the ci.yml.

javeedambu avatar Nov 19 '23 10:11 javeedambu

Linking issue https://github.com/skills/test-with-actions/issues/48

@skills/technical-reviewers Would ya'll mind taking a look at this one? 👀 👍

cmwilson21 avatar Nov 21 '23 16:11 cmwilson21

This error is intentional.

Even after the code is indented properly in ci.yml, you will see a build error in GitHub Actions. We'll fix this in the next step.

sinsukehlab avatar Nov 24 '23 13:11 sinsukehlab