uetchy / create-create-app

⚡️ Create your own `create-something` app.
MIT License
94 stars 24 forks source link

github action file `hashFiles()` #57

Open eunchurn opened 1 year ago

eunchurn commented 1 year ago

Error

Parse error on line 46:
...{{ runner.os }}-${{ hashFiles('**/packag
-----------------------^
Expecting 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'INVALID'

hashFiles() is github action function

https://docs.github.com/en/actions/learn-github-actions/expressions#hashfiles

How to reproducing

add .github/workflows/unit-test.yml in template/default

write this in any github action template.

      - name: Restore cache
        uses: actions/cache@v3
        with:
          path: |
            node_modules
          key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
          restore-keys: |
            ${{ runner.os }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-

I think ignore glob pattern is needed.

eunchurn commented 1 year ago

I found handlebars's raw-blocks https://handlebarsjs.com/guide/block-helpers.html#raw-blocks