Skip to content

fix(github-actions): pin context.sha when reading source files during org file sync - #4025

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
josephperrott:fix/sync-pinning-and-preview-validation
Oct 12, 2026
Merged

alan-agius4 merged 1 commit into
angular:mainfrom
josephperrott:fix/sync-pinning-and-preview-validation

Conversation

@josephperrott

@josephperrott josephperrott commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Pin context.sha when reading source files in org-file-sync so synchronized files are always read from the exact commit that triggered the workflow.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces unit tests and refactors code for testability across two GitHub Actions: org-file-sync and upload-artifacts-to-firebase. Specifically, it exports core functions, adds validation for commit SHAs and artifact metadata against trusted workflow payloads, and configures Bazel targets for Jasmine testing. Feedback on these changes suggests removing .trim() from the SHA validation regex to prevent passing untrimmed strings with whitespace to the GitHub API, and using optional chaining when accessing payload.workflow_run to avoid potential runtime errors if the parsed JSON is null.

Comment thread github-actions/org-file-sync/lib/main.ts Outdated
@josephperrott
josephperrott force-pushed the fix/sync-pinning-and-preview-validation branch 2 times, most recently from b793301 to 9bf5a3d Compare October 9, 2026 19:08
Comment thread github-actions/org-file-sync/lib/main.ts
@josephperrott josephperrott changed the title fix(github-actions): pin context.sha during org file sync and validate preview artifact metadata fix(github-actions): pin context.sha when reading source files during org file sync Oct 12, 2026
@josephperrott
josephperrott force-pushed the fix/sync-pinning-and-preview-validation branch from 9bf5a3d to c38e448 Compare October 12, 2026 09:13
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Oct 12, 2026
@alan-agius4
alan-agius4 merged commit 520febc into angular:main Oct 12, 2026
17 checks passed
@alan-agius4

Copy link
Copy Markdown
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants