s0 / git-publish-subdir-action

GitHub Action to push a subdirectory as a branch to any git repo (e.g. for GitHub Pages)
https://github.com/marketplace/actions/push-git-subdirectory-as-branch
MIT License
208 stars 36 forks source link

Error: no such file or directory #88

Closed uurha closed 1 year ago

uurha commented 1 year ago

After last update I start receiving error what never happens before. Before same setup was fully working.

Run s0/git-publish-subdir-action@develop
  env:
    REPO: self
    BRANCH: upm
    FOLDER: Assets/Plugins/${GITHUB_REPOSITORY#*/}
    GITHUB_TOKEN: ***
    SKIP_EMPTY_COMMITS: true
    MESSAGE: {msg}
Cloning into '/tmp/git-publish-subdir-action-X1P[3](https://github.com/uurha/BuildNotification/actions/runs/3517667603/jobs/5895702960#step:3:3)oh/repo'...

From https://github.com/uurha/BuildNotification
 * [new branch]      upm        -> upm

##[info] Checking if branch upm exists already
data   upm

Switched to branch 'upm'

##[info] Updating branch upm
##[info] Removing all files from target branch
##[info] Copying all files from /home/runner/work/BuildNotification/BuildNotification/Assets/Plugins/${GITHUB_REPOSITORY#*/}
Error: no such file or directory: /home/runner/work/BuildNotification/BuildNotification/Assets/Plugins/${GITHUB_REPOSITORY#*/}/
    at /home/runner/work/_actions/s0/git-publish-subdir-action/develop/action/dist/index.js:11[5](https://github.com/uurha/BuildNotification/actions/runs/3517667603/jobs/5895702960#step:3:5):19
    at Generator.next (<anonymous>)
    at fulfilled (/home/runner/work/_actions/s0/git-publish-subdir-action/develop/action/dist/index.js:[7](https://github.com/uurha/BuildNotification/actions/runs/3517667603/jobs/5895702960#step:3:7)9:5[8](https://github.com/uurha/BuildNotification/actions/runs/3517667603/jobs/5895702960#step:3:8))

Can you suggest possible ways to fix it or may be some API changed.

s0 commented 1 year ago

Hi.

The reason that this is broken is because we're no longer using bash to copy files, and instead are using Node.js for the implementation. This action didn't officially support bash expressions in the folder name and you were relying on an implementation detail unfortunately.

Getting the repository name from the event context will probably work instead:

    FOLDER: Assets/Plugins/${{ github.event.repository.name }}
uurha commented 1 year ago

ah, may be I miss last release notes, thanks for explaining. I'll try in few hours and come back with results)

uurha commented 1 year ago

Yes, It's works, thanks) Could please you include info that Bash not officially supported into documentation?