Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action fails when inbound and existing excluded assets differ in state #520

Closed
csuwildcat opened this issue Oct 14, 2020 · 7 comments · Fixed by #521
Closed

Action fails when inbound and existing excluded assets differ in state #520

csuwildcat opened this issue Oct 14, 2020 · 7 comments · Fixed by #521
Assignees
Labels
bug Something isn't working resolved

Comments

@csuwildcat
Copy link

csuwildcat commented Oct 14, 2020

Describe the bug

When using the excluded asset option, the Action fails if one of the inbound assets differs from the existing set.

To Reproduce

  1. Turned on asset exclusion for node_modules
  2. Ran Action
  3. Deletion task hits a file inside of node_modules that doesn't exist in the current folder
  4. Produces the following error: Error: Action failed with "ENOENT: no such file or directory, scandir '/home/runner/actions_github_pages_1602700363975/node_modules/@traptitech/markdown-it-katex/.idea'"

Expected behavior

The Action should not fail if a directory it tries to delete doesn't exist, it should simply skip it and proceed with deletion of the next directory/file it is directed to.

Your YAML file

name: render-specs

on:
  push:
    branches:
      - main

jobs:
  build-and-deploy-spec:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout 🛎️
        uses: actions/checkout@v2
        with:
          persist-credentials: false

      - name: Install and Render
        run: |
          npm install
          node -e "require('spec-up')({ nowatch: true })"

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./
          exclude_assets: '.github,node_modules/**'
          force_orphan: true
@csuwildcat csuwildcat added the bug Something isn't working label Oct 14, 2020
@csuwildcat csuwildcat changed the title sample_title Action fails when inbound and existing excluded assets differ in state Oct 14, 2020
@peaceiris
Copy link
Owner

Thanks.

Related to #163 (comment)

BTW, I recommend you to remove the node_modules directory before the deployment step. Due to the node_modules generally takes a large size of disk space, this action probably takes a long time to list up and delete excluding assets. In addition, since this action creates a copy of publish_dir and deploys it, the copy operation maybe takes a lot of time for it.

      - name: Install and Render
        run: |
          npm install
          node -e "require('spec-up')({ nowatch: true })"
+         rm -rf node_modules

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./
-         exclude_assets: '.github,node_modules/**'
          force_orphan: true

@csuwildcat
Copy link
Author

We already have node_modules in the .gitignore file, and it's not checked into any of the repos - this is happening when the project builds and installs all the dependencies within the env it is running, which does not adhere to the .gitignore directives, causing this Action to write node_modules into the destination branch.

@csuwildcat
Copy link
Author

Ah, I just saw the rm -rf line you added there in the example - that makes sense, thank you for the suggestion!

@peaceiris peaceiris mentioned this issue Oct 15, 2020
1 task
peaceiris added a commit that referenced this issue Oct 15, 2020
Close #520

Related to:

- pr: #512 
- #507 #509 
- #390
- #324
- #103
peaceiris pushed a commit that referenced this issue Oct 15, 2020
Close #520

Related to:

- pr: #512
- #507 #509
- #390
- #324
- #103
@peaceiris
Copy link
Owner

Sorry, there was a bug in #512. This problem is really fixed in #521, v3.7.2 has been released, and the v3 tag is updated now.

Thank you!

@csuwildcat
Copy link
Author

@peaceiris so are you saying I can/should still use manual removal via node commands to exclude files from the runs, or that it's safe to against use the built-in exclude feature?

@peaceiris
Copy link
Owner

I still recommend my suggestion for fast deployment.

The bug was that you mentioned in #520 (comment). Dotfiles on a root directory had been ignored in the copy operation.

@github-actions
Copy link
Contributor

This issue has been LOCKED because of it being resolved!

The issue has been fixed and is therefore considered resolved.
If you still encounter this or it has changed, open a new issue instead of responding to solved ones.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants