Skip to content

workflows: swap softprops for gh CLI, add CloudFront reachability check, remove --acl#18

Merged
harshita-gupta merged 3 commits intomainfrom
harshitagupta/node-gyp-s3-followups
Apr 21, 2026
Merged

workflows: swap softprops for gh CLI, add CloudFront reachability check, remove --acl#18
harshita-gupta merged 3 commits intomainfrom
harshitagupta/node-gyp-s3-followups

Conversation

@harshita-gupta
Copy link
Copy Markdown
Member

@harshita-gupta harshita-gupta commented Apr 21, 2026

Summary

Three follow-up corrections to #17 based on post-merge audit findings:

  1. Remove --acl public-read from aws s3 cp. The bucket has disable_confusing_acls = true (BucketOwnerEnforced), which disables ACLs entirely. BlockPublicAcls + IgnorePublicAcls provide additional coverage. The ACL flag is silently ignored. The IAM role (S3_ACCESS_MODE.PUT) also doesn't grant PutObjectAcl. Reads go via CloudFront OAC, not public-S3.

  2. Replace softprops/action-gh-release with gh release upload (first-party GitHub CLI). gh is pre-installed on GitHub-hosted runners. Removes a third-party (single-maintainer) supply-chain dependency. --clobber matches softprops's default overwrite behavior.

  3. Add a post-upload CloudFront reachability check. If the CloudFront path_patterns allowlist doesn't include the key's prefix, Mac Bazel builds will silently 403. curl -fsSI against the CloudFront URL fails the workflow at upload time rather than at consumer-build time.

S3 path stays node-gyp/* — this PR no longer changes it. The CloudFront allowlist entry for node-gyp/* is being added in codez #390222.

Action pinning

Tag-pinned per codez convention (100% of codez workflows use tags, not SHAs).

Merge prerequisites

  • codez #390222 merged AND applied via Spacelift (adds node-gyp/* to CloudFront path_patterns). Without this, the post-upload CloudFront reachability check will 403.

Test plan

  • Merge
  • Dispatch build-node-packages.yml from main (not from a version branch)
  • Confirm "Configure AWS credentials" step succeeds
  • Confirm "Upload packages to S3" step succeeds
  • Confirm "Verify upload is reachable via CloudFront" step returns 200 from asana-oss-cache.asana.biz
  • Record the two sha256 hashes + S3 URLs printed by the final step — these go into codez #388870's tools_repositories.bzl

Risks

  • If codez #390222 isn't applied via Spacelift yet, the post-upload CloudFront check returns 403. The S3 upload still succeeds (just becomes inaccessible from Macs) — low-blast-radius failure mode.

🤖 Generated with Claude Code

…ck, remove --acl

Three follow-up corrections to PR #17:

1. Remove `--acl public-read` from `aws s3 cp`.
   The bucket has `disable_confusing_acls = true` (BucketOwnerEnforced), which
   disables ACLs entirely. `BlockPublicAcls` + `IgnorePublicAcls` provide
   additional coverage. The ACL flag is silently ignored. The IAM role
   (`S3_ACCESS_MODE.PUT`) also doesn't grant `PutObjectAcl`. Reads go via
   CloudFront OAC, not public-S3.

2. Replace `softprops/action-gh-release` with GitHub's first-party `gh` CLI.
   `gh release upload` is pre-installed on GitHub-hosted runners, removes a
   third-party (single-maintainer) supply-chain dependency, and behaves
   equivalently with `--clobber`.

3. Add a post-upload CloudFront reachability check (`curl -fI`).
   If the CloudFront path_patterns allowlist doesn't include the key's prefix,
   Mac Bazel builds will silently 403. Failing the workflow here surfaces the
   issue before consumers hit it.

S3 path stays `node-gyp/*` (this PR no longer changes it — see codez PR #390222
which adds `node-gyp/*` to CloudFront's path_patterns in system_packages.tf).

Action pinning: tag-pinned per codez convention (100% of codez workflows use
tags, not SHAs).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@harshita-gupta harshita-gupta force-pushed the harshitagupta/node-gyp-s3-followups branch from 22846ef to b96733c Compare April 21, 2026 19:58
@harshita-gupta harshita-gupta changed the title workflows: fix node-gyp S3 path, swap softprops for gh CLI, add CloudFront check workflows: swap softprops for gh CLI, add CloudFront reachability check, remove --acl Apr 21, 2026
@harshita-gupta harshita-gupta marked this pull request as ready for review April 21, 2026 22:57
Comment thread .github/workflows/build-node-packages.yml Outdated
Comment thread .github/workflows/build-node-packages.yml Outdated
Co-authored-by: Eli Skeggs <1348991+skeggse@users.noreply.github.com>
Comment thread .github/workflows/build-node-packages.yml Outdated
Comment thread .github/workflows/build-node-packages.yml Outdated
…titution in run: blocks

Eli's review flagged `${{ matrix.arch }}` in a run: block as an injectable
pattern even though the matrix values are hardcoded and not truly exploitable.
Apply the pattern consistently across the whole workflow:

- Hoist PLATFORM, ARCH, BAZEL_ARCH, REPO to job-level env so each step can
  reference them as shell variables ($ARCH etc.) rather than GitHub Actions
  expressions (${{ matrix.arch }}). Job-level env evaluates matrix context
  since the job is instantiated per matrix combination, so this DRYs up the
  per-step env blocks.
- Rewrite every `run:` block to reference the job-level env vars. No more
  `${{ ... }}` expressions inside shell scripts.
- Secret references (GITHUB_TOKEN) remain step-scoped per least-privilege.
- Minor cleanup: collapse three separate `echo ... >> $GITHUB_ENV` lines into
  a single `{ ...; } >> "$GITHUB_ENV"` block.

Addresses Eli's inline comment on line 114 of the pre-hoist file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@harshita-gupta harshita-gupta merged commit 56b09b1 into main Apr 21, 2026
14 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants