'make can't find files from GitHub action

I'm adding GitHub action to my repo that calls make. This is my Makefile:

CP=cp
TEST=test

all: build

image.z:
    ./make-image.js -d ./root -f image.z

build: image.z
    $(TEST) -d dist || mkdir ./dist
    $(CP) ./index.{html,js} ./dist
    $(CP) ./image.z ./dist

and got an error:

cp: cannot stat './index.{html,js}': No such file or directory
make: *** [Makefile:11: build] Error 1
Error: Process completed with exit code 2.

My makefile works locally.

This is my workflow file:

name: Deploy
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 1
      - name: setup node
        uses: actions/setup-node@v2
        with:
          node-version: '17'
      - name: "deps"
        run: "npm ci"
      - name: "build"
        run: "make"
      - name: upload
        uses: betanzos/scp-upload@v1
        with:
          source: "./dist/*"
          host: ${{ secrets.HOST }}
          username: ${{ secrets.USERNAME }}
          port: ${{ secrets.PORT }}
          recursive: 'true'
          key: ${{ secrets.SSH_KEY }}
          remote_dir: '~/websites/terminal/fake/'


Solution 1:[1]

Found the answer on SuperUser Bash extended globbing inside a Makefile

It seems that the Make in GitHub action is using sh by default. Adding:

SHELL=/bin/bash

to Makefile solved the issue

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jcubic