user11350388
user11350388

Reputation: 351

Github Actions: No such file or directory given filepath

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/[email protected]
      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

Upvotes: 5

Views: 10173

Answers (1)

Krzysztof Madej
Krzysztof Madej

Reputation: 40849

Please add checkout step at the beginning:

- name: Checkout
  uses: actions/checkout@v2

Upvotes: 15

Related Questions