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

Add exclude option #21

Closed
wants to merge 1 commit into from
Closed

Add exclude option #21

wants to merge 1 commit into from

Conversation

YuyaAizawa
Copy link

Add exclude input parameter for tar option --exclude.

Assuming a project using npm, we do not want to include node_modules files in the tar.
This change make it possible by the followings

- name: Install dependencies
  run: npm ci

- name: Build
  run: npm run build

- name: Upload artifacts
  uses: actions/upload-pages-artifact
  with:
    path: .
    exclude: node_modules

@YuyaAizawa YuyaAizawa requested a review from a team as a code owner September 2, 2022 07:36
@YuyaAizawa
Copy link
Author

I came up with a simple workaround after submitting this pull request. It worked as expected, although it was a little weird to have it be like an injection...

- uses: actions/upload-pages-artifact@v1
  with:
    path: '. --exclude=node_modules'

@yoannchaudet
Copy link
Contributor

yoannchaudet commented Sep 12, 2022

Path escaping has been fixed in #19 so your workaround should not work anymore.

Why are you using . as your path? Most (all?) static site generators place static (and built) assets in a dedicated folder. Otherwise you would also include all your source files and package.json in your site...

What does your build script do now?

@YuyaAizawa
Copy link
Author

I planed that my site generator places static assets in root folder for simplification. I assumed that few folders makes it easy for beginner developers and it would not be a problem to publish files that are not needed as long as they are not too large.

But I have now reconsidered that the files to be made public should be explicit and separated in a single folder. The build script is also set to path: public/ now. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants