deploy: create tar archive for gh-pages manually#2173
deploy: create tar archive for gh-pages manually#2173jonchurch wants to merge 2 commits intoexpressjs:gh-pagesfrom
Conversation
Pin checkout, setup-ruby, configure-pages, and deploy-pages actions to specific commit SHAs for supply chain security.
upload-pages-artifact excludes hidden files, so .well-known isnt being published. see actions/upload-pages-artifact#129 This PR drops that action to tar the _site dir ourselves and hands it off to upload-artifact for publishing. We probably don't even need to use that action if it ever has the config changed, but I'll open a PR to them with a include-hidden-files option
✅ Deploy Preview for expressjscom-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Hidden files and directories (e.g. `.well-known`) are unconditionally excluded from the tar archive. There is no way to include them. (actions#129) Add an `include-hidden-files` input (default `false`) that skips the `--exclude=.[^/]*` pattern when set to `true`. `.git` and `.github` are always excluded regardless. Test coverage added for the new option. `actions/upload-artifact` introduced hidden file exclusion and a corresponding `include-hidden-files` option in [v4.4.0](https://github.com/actions/upload-artifact/releases/tag/v4.4.0). This action adopted the same exclusion behavior in its tar step but never added the equivalent option. This PR closes that gap. See [expressjs/expressjs.com#2173](expressjs/expressjs.com#2173) for an example of the only sane workaround without this option. Which is to drop this action, manually create the tar, and handing it to `upload-artifact` directly.
Hidden files and directories (e.g. `.well-known`) are unconditionally excluded from the tar archive. There is no way to include them. (actions#129) Add an `include-hidden-files` input (default `false`) that skips the `--exclude=.[^/]*` pattern when set to `true`. `.git` and `.github` are always excluded regardless. Test coverage added for the new option. `actions/upload-artifact` introduced hidden file exclusion and a corresponding `include-hidden-files` option in [v4.4.0](https://github.com/actions/upload-artifact/releases/tag/v4.4.0). This action adopted the same exclusion behavior in its tar step but never added the equivalent option. This PR closes that gap. See [expressjs/expressjs.com#2173](expressjs/expressjs.com#2173) for an example of the only sane workaround without this option. Which is to drop this action, manually create the tar, and handing it to `upload-artifact` directly.
# The Problem Hidden files and directories (e.g. `.well-known`) are unconditionally excluded from the tar archive. There is no way to include them. (actions#129) # The Solution Add an `include-hidden-files` input (default `false`) that skips the `--exclude=.[^/]*` pattern when set to `true`. `.git` and `.github` are always excluded regardless. Test coverage added for the new option. I think this is the right approach rather than actions#134. Keep the default behavior safe, and give a sane option to users who know what they're doing. It was safe enough for upload-artifact, it should be safe enough here. # Context `actions/upload-artifact` introduced hidden file exclusion and a corresponding `include-hidden-files` option in [v4.4.0](https://github.com/actions/upload-artifact/releases/tag/v4.4.0). This action adopted the same exclusion behavior in its tar step but never added the equivalent option. This PR closes that gap. The only sane workaround without this option is to drop this action, manually create the tar, and hand it to `upload-artifact` directly. See [expressjs/expressjs.com#2173](expressjs/expressjs.com#2173) for an example.
bjohansebas
left a comment
There was a problem hiding this comment.
Could you create a POC to verify that this solution actually works? If not, I’ll do it over the weekend
|
I didnt do a PoC or actually test this. What I did was copy the tar logic from the upload-pages-artifact action verbatim, but removed the hidden file exclusion. Ive definitely merged untested action changes that didnt work before hehe. Im confident in this one, but havent tested it. Will report back if I do test it |
|
My plate is too full to work on a PoC right now. You’re the captain, so I trust you. |
|
The new site won’t need this since we’re going to use Astro’s action, which already solves that problem. And since we’re close to launching the new site, I’m going to close this. |
Pull request was closed

upload-pages-artifact excludes hidden files, so .well-known isnt being
published. see actions/upload-pages-artifact#129
This PR drops that action to tar the _site dir ourselves and hands it
off to upload-artifact for publishing.
We probably don't even need to use that action if it ever has the config
changed (creating the tar is a one liner), but I'll open a PR to them with a
include-hidden-filesoptionEdit: PR to upstream w/ the option