Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
cache-dependency-path: office/requirements-ci.txt
- name: Verify release identity and main ancestry
- name: Verify release identity and current main tip
env:
RELEASE_TAG: ${{ github.ref_name }}
run: |
Expand Down Expand Up @@ -66,8 +66,9 @@ jobs:
}
NODE
git fetch --no-tags origin refs/heads/main:refs/remotes/origin/main
if ! git merge-base --is-ancestor "$GITHUB_SHA" refs/remotes/origin/main; then
echo "::error::Release tags must point to a commit already reachable from main."
main_sha="$(git rev-parse refs/remotes/origin/main)"
if [[ "$GITHUB_SHA" != "$main_sha" ]]; then
echo "::error::Release tags must point to the current protected main tip."
exit 1
fi
- name: Install JavaScript dependencies
Expand Down
22 changes: 22 additions & 0 deletions src/releaseBrowserEvidence.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,28 @@ const browserSpec = repositoryFile('tests/browser/specs/clipboard.browser.spec.t
const consensusSpec = repositoryFile('tests/browser/specs/clipboard.consensus.spec.ts');

describe('release cross-engine browser evidence contract', () => {
it('requires the release tag commit to equal the current protected main tip', () => {
const buildJob = workflowJob(
workflow,
'build-release-artifacts',
'browser-release-evidence',
);

expect(buildJob).toContain(
'git fetch --no-tags origin refs/heads/main:refs/remotes/origin/main',
);
expect(buildJob).toContain(
'main_sha="$(git rev-parse refs/remotes/origin/main)"',
);
expect(buildJob).toContain('if [[ "$GITHUB_SHA" != "$main_sha" ]]; then');
expect(buildJob).toContain(
'Release tags must point to the current protected main tip.',
);
expect(buildJob).not.toContain(
'git merge-base --is-ancestor "$GITHUB_SHA" refs/remotes/origin/main',
);
});

it('tests the packed npm artifact built from the exact tagged source', () => {
const buildJobIndex = workflow.indexOf(' build-release-artifacts:');
const browserJobIndex = workflow.indexOf(' browser-release-evidence:');
Expand Down
Loading