Github Actions: No such file or directory given filepath

Viewed 3108

I'm using Github Actions for one of my repositories with the following workflow .yml file:

name: Minify source files

on: [push]

jobs:
  read:
    runs-on: ubuntu-18.04
    
    steps:
    - name: Copy files
      run: cp src/Javascript/syntax.js out
    - name: Copy files
      run: cp src/CSS/syntax.css out
    - name: Checkout
      uses: actions/checkout@v2
    - name: minisauras
      uses: TeamTigers/minisauras@v2.0.0
      env:
        GITHUB_TOKEN: ${{ secrets.MINIFIER }}
      id: dir
      with:
        directory: 'out/'

The action is supposed to copy a file called 'syntax.js' and 'syntax.css' from the folders 'src/Javascript' and 'src/CSS'. When running the action, I get the error:

cp: cannot stat 'src/Javascript/syntax.js': No such file or directory

Here is my project structure:

Repository
├── .github/workflows
    ├── main.yml

├── src
    ├── CSS
        ├── syntax.css
    ├── Javascript 
        ├── syntax.js

1 Answers

Please add checkout step at the beginning:

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