# Parsing a README.md File To Fill A Folder

**URL:** <https://revolt.metaeducation.com/forum/t/parsing-a-readme-md-file-to-fill-a-folder/1840>\
**Category:** Show & Tell\
**Created:** [June 14, 2022, 11:41am UTC](https://revolt.metaeducation.com/forum/t/parsing-a-readme-md-file-to-fill-a-folder/1840 "2022-06-14T11:41:40Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![hostilefork](https://revolt.metaeducation.com/forum/user_avatar/revolt.metaeducation.com/hostilefork/32/421_2.png) [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Post date:** [June 14, 2022, 11:41am UTC](https://revolt.metaeducation.com/forum/t/parsing-a-readme-md-file-to-fill-a-folder/1840/1 "2022-06-14T11:41:40Z")

</div>

I've integrated @gchiu's [Cypress Tests](https://revolt.metaeducation.com/forum/t/js-testing-with-cypress-io/1778/3) to the GitHub workflow.

There's a certain number of things we want to have work before we "greenlight" a new libr3.wasm file. Things like Graham's prescription writing app or chess demo are examples of this.

But we don't want the test scripts for those things to live in the Revolt repository. Because they need to change as the apps change--and they should also be running whenever those apps get a new commit pushed.

At first I just did a **wget** of the scripts:

```
cd tests/cypress/e2e
wget https://gitlab.com/Zhaoshirong/rebol-chess/-/raw/master/cypress/e2e/chess.cy.js
wget https://raw.githubusercontent.com/gchiu/midcentral/main/cypress/e2e/rx-app.cy.js

```

But this encountered an error, because when git has a directory with no files in it...it doesn't exist. So there was no e2e directory.

I could have just said **mkdir tests/cypress/e2e** as part of the workflow. But I figured making a README.md file and putting it in the directory to explain what it was would be easier.

This gave me an idea: _What if I put the URLs in the README.md, and then parsed them out and fetched them?_ So that's what I did instead!

**[Here's the README.md](https://raw.githubusercontent.com/metaeducation/ren-c/master/tests/cypress/e2e/README.md)**, which has **`* https://whatever`** lines in it.

Then here's the script that uses the Revolt GitHub Action:

```
- name: Collect Cypress Tests from Repositories We Want to Keep Working
  uses: metaeducation/ren-c-action@release
  with:
    script: |
      cd %tests/cypress/e2e/
      list: uparse (as text! read %README.md) [
          collect some [
              '* space [keep url!] newline
            | thru newline
          ]
      ]
      for-each url list [
          filename: second split-path url
          write filename (read url)
      ]

```

---

_[View the full topic](https://revolt.metaeducation.com/forum/t/parsing-a-readme-md-file-to-fill-a-folder/1840)._
