Comments (9)
I was planning to reply to this but time got away for me and I didn't. But anyhow, it seems like you came to the exact same conclusion as me. If there are no hidden files an error will be thrown. However, the reason I never PRed this like you did was because even though this fails, the library used fails silently and proceeds to the next element in the lit for
cp
.So for me, even though I don't have any hidden files and even though the command fails, it still copied all the other files. Did you actually confirm that without this fix the non hidden files does not get copied and with your fix they do? Because even though we had the same issue and came to the same conclusion, this fix was not needed for me.
That's it, no matter whether there are hidden files, files will be copied successfully.
So I think this issue and PR #1047 could be closed. @liudonghua123
see my workflow runs : "nothing to commit" because the static files didn't change at all
Running expectedly , but there's still cp: no such file or directory
error
from actions-gh-pages.
I seem to have this issue as well but I do have the publish_dir
set. My workflow used to work fine but stopped working without any changes to the action.
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
It used to work fine 5 months ago (sadly logs no longer available). In the latest build I see
[INFO] chdir /home/runner/actions_github_pages_1694213859334
[INFO] prepare publishing assets
[INFO] copy /home/runner/work/a-calculator/a-calculator/dist to /home/runner/actions_github_pages_1694213859334
cp: no such file or directory: /home/runner/work/a-calculator/a-calculator/dist/.*
The path is correct however, in that workflow I added a list of the directory to confirm it has content:
Run ls -l /home/runner/work/a-calculator/a-calculator/dist || true
total 12
drwxr-xr-x 2 runner docker 4096 Sep 8 22:57 assets
-rw-r--r-- 1 runner docker 794 Sep 8 22:57 index.html
-rw-r--r-- 1 runner docker 1497 Sep 8 22:57 vite.svg
So I assume it would've worked if the copy command had been just *
instead of .*
.
EDIT Looks like assuming there are hidden files is the issue here.
› tree -a
.
├── dst
├── src
│ ├── .foo
└── src-no-hidden
└── foo
› cp -RfL src/.* dst
› cp -RfL src-no-hidden/.* dst
zsh: no matches found: src-no-hidden/.*
› tree -a
.
├── dst
│ └── .foo
├── src
│ └── .foo
└── src-no-hidden
└── foo
At this line both *
and .*
are unconditionally copied but I think we need to check if hidden files exist, doesn't seem like there's any option for this in shelljs docs.
actions-gh-pages/src/git-utils.ts
Line 60 in 579d468
Update
I think I was a bit too quick commenting on this issue! I did some more debugging and this is indeed just a silently accepted command, it will copy all other files even if the .*
fails.
So it seems like this is working as intended and the reason I saw nothing to commit, working tree clean
is because I actually don't have any changes in my PR. I need to debug and figure out why the changes I'm expecting isn't a part of the artifacts but that's not related to this action!
from actions-gh-pages.
I was planning to reply to this but time got away for me and I didn't. But anyhow, it seems like you came to the exact same conclusion as me. If there are no hidden files an error will be thrown. However, the reason I never PRed this like you did was because even though this fails, the library used fails silently and proceeds to the next element in the lit for cp
.
So for me, even though I don't have any hidden files and even though the command fails, it still copied all the other files. Did you actually confirm that without this fix the non hidden files does not get copied and with your fix they do? Because even though we had the same issue and came to the same conclusion, this fix was not needed for me.
from actions-gh-pages.
@abolla22, did you ever figure this out? I've also run into a similar issue.
I ran into this issue because my build process was mistakenly not created the static assets in the folder I expected. My issues is resolved
from actions-gh-pages.
cp: no such file or directory: /home/runner/work/solana_tools/solana_tools/client/dist/.*
[INFO] ForceOrphan: false
/usr/bin/git clone --depth=1 --single-branch --branch gh-pages **github.com/iRoySwift/solana_tools.git /home/runner/actions_github_pages_1692272013060
Cloning into '/home/runner/actions_github_pages_1692272013060'...
[INFO] clean up /home/runner/actions_github_pages_1692272013060
[INFO] chdir /home/runner/actions_github_pages_1692272013060
/usr/bin/git rm -r --ignore-unmatch *
rm '.nojekyll'
[INFO] chdir /home/runner/actions_github_pages_1692272013060
[INFO] prepare publishing assets
[INFO] copy /home/runner/work/solana_tools/solana_tools/client/dist to /home/runner/actions_github_pages_1692272013060
cp: no such file or directory: /home/runner/work/solana_tools/solana_tools/client/dist/.
[INFO] delete excluded assets
rm: no paths given
from actions-gh-pages.
Hi @abolla22 ,
Can you post the steps for solving this problem? :)
from actions-gh-pages.
The publish_dir
should not be empty. Please set the correct path to your directory including building assets.
from actions-gh-pages.
Here is my new example repo. FYI https://github.com/peaceiris/test-mdbook
from actions-gh-pages.
I seem to have this issue as well but I do have the
publish_dir
set. My workflow used to work fine but stopped working without any changes to the action.- name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./distIt used to work fine 5 months ago (sadly logs no longer available). In the latest build I see
[INFO] chdir /home/runner/actions_github_pages_1694213859334 [INFO] prepare publishing assets [INFO] copy /home/runner/work/a-calculator/a-calculator/dist to /home/runner/actions_github_pages_1694213859334 cp: no such file or directory: /home/runner/work/a-calculator/a-calculator/dist/.*
The path is correct however, in that workflow I added a list of the directory to confirm it has content:
Run ls -l /home/runner/work/a-calculator/a-calculator/dist || true total 12 drwxr-xr-x 2 runner docker 4096 Sep 8 22:57 assets -rw-r--r-- 1 runner docker 794 Sep 8 22:57 index.html -rw-r--r-- 1 runner docker 1497 Sep 8 22:57 vite.svg
So I assume it would've worked if the copy command had been just
*
instead of.*
.EDIT Looks like assuming there are hidden files is the issue here.
› tree -a . ├── dst ├── src │ ├── .foo └── src-no-hidden └── foo › cp -RfL src/.* dst › cp -RfL src-no-hidden/.* dst zsh: no matches found: src-no-hidden/.* › tree -a . ├── dst │ └── .foo ├── src │ └── .foo └── src-no-hidden └── fooAt this line both
*
and.*
are unconditionally copied but I think we need to check if hidden files exist, doesn't seem like there's any option for this in shelljs docs.actions-gh-pages/src/git-utils.ts
Line 60 in 579d468
Update
I think I was a bit too quick commenting on this issue! I did some more debugging and this is indeed just a silently accepted command, it will copy all other files even if the
.*
fails.So it seems like this is working as intended and the reason I saw
nothing to commit, working tree clean
is because I actually don't have any changes in my PR. I need to debug and figure out why the changes I'm expecting isn't a part of the artifacts but that's not related to this action!
I have the similar issue, the publishDir
directory does not contain .*
files, so cp from shelljs returns error.
actions-gh-pages/src/git-utils.ts
Lines 59 to 60 in 74d2f4c
$ node
> const {ls, cp}=require('shelljs')
> const publishDir = 'dist'
> cp('-RfL', [`${publishDir}/*`, `${publishDir}/.*`], '/tmp/');
cp: no such file or directory: dist/.*
[String: ''] {
stdout: '',
stderr: 'cp: no such file or directory: dist/.*',
code: 1,
cat: [Function: bound ],
exec: [Function: bound ],
grep: [Function: bound ],
head: [Function: bound ],
sed: [Function: bound ],
sort: [Function: bound ],
tail: [Function: bound ],
to: [Function: bound ],
toEnd: [Function: bound ],
uniq: [Function: bound ]
}
>
undefined
> ls(`${publishDir}/*`)
[
'app.aeeadc2a.css',
'chunk-vendors.caf800b8.css',
'dist/favicon.ico',
...
stdout: 'app.aeeadc2a.css\n' +
'chunk-vendors.caf800b8.css\n' +
'dist/favicon.ico\n' +
...
stderr: null,
code: 0,
cat: [Function: bound ],
exec: [Function: bound ],
grep: [Function: bound ],
head: [Function: bound ],
sed: [Function: bound ],
sort: [Function: bound ],
tail: [Function: bound ],
to: [Function: bound ],
toEnd: [Function: bound ],
uniq: [Function: bound ]
]
> ls(`${publishDir}/.*`)
ls: no such file or directory: dist/.*
[
stdout: '',
stderr: 'ls: no such file or directory: dist/.*',
code: 2,
cat: [Function: bound ],
exec: [Function: bound ],
grep: [Function: bound ],
head: [Function: bound ],
sed: [Function: bound ],
sort: [Function: bound ],
tail: [Function: bound ],
to: [Function: bound ],
toEnd: [Function: bound ],
uniq: [Function: bound ]
]
>
I debugged this line of code (cp('-RfL', ['dist/*', 'dist/.*'], '/tmp')
), 'dist/*'
will expand as expected while 'dist/.*'
will not and if the publishDir
does not contains dot file, it will failed to execute cp
.
Maybe it should process ${publishDir}/.*
with care when cp
.
from actions-gh-pages.
Related Issues (20)
- support: `keep_files` and multiple docs versions
- proposal: keeping_ Files can be a string type, filtering files through wildcards.
- proposal: keep_ files can be a string type, filtering files through wildcards.
- support: can an application token be used to deploy? HOT 4
- support: Pushing to external repo fails HOT 1
- proposal: update node version to 20 HOT 2
- support: Unable to locate executable file: git.
- support: Error: Action failed with "The process '/usr/bin/git' failed with exit code 128" HOT 5
- proposal: Please create a new release to include the Node 20 version bump HOT 11
- support:
- support: Cannot push to protected branches using Enterprise TOKEN HOT 3
- support: action failed with "fetch first" hint HOT 3
- proposal: Add an option to allow deploying into the main branch
- proposal: destination_dir with recursive option.
- support: Actions/cache for Hugo modules with Hugo v0.127.0 HOT 5
- support: Error: Unable to resolve actions. Cannot access repositories 'peaceiris/actions-gh-pages' HOT 12
- support: self-hosted runner
- proposal: output working directory
- proposal: Issue a warning if content is to large
- support: Action failed with "The process '/usr/bin/git' failed with exit code 1" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from actions-gh-pages.