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
2 changes: 1 addition & 1 deletion .github/workflows/npm-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
shell: bash
run: |
set -euo pipefail
if [[ "$GITHUB_REPOSITORY" != "synthetic-sciences/OpenScience" || "$GITHUB_REF" != "refs/heads/main" ]]; then
if [[ "${GITHUB_REPOSITORY,,}" != "synthetic-sciences/openscience" || "$GITHUB_REF" != "refs/heads/main" ]]; then
echo "::error::npm test publishing uses registry credentials and must be dispatched from synthetic-sciences/OpenScience main; received $GITHUB_REPOSITORY at $GITHUB_REF."
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
shell: bash
run: |
set -euo pipefail
if [[ "$GITHUB_REPOSITORY" != "synthetic-sciences/OpenScience" || "$GITHUB_REF" != "refs/heads/main" ]]; then
if [[ "${GITHUB_REPOSITORY,,}" != "synthetic-sciences/openscience" || "$GITHUB_REF" != "refs/heads/main" ]]; then
echo "::error::Production releases must be dispatched from synthetic-sciences/OpenScience main; received $GITHUB_REPOSITORY at $GITHUB_REF."
exit 1
fi
Expand Down
13 changes: 13 additions & 0 deletions backend/cli/test/installation/release-order.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,16 @@ test("production publish pushes the release commit before targeting it on GitHub
expect(release).toBeGreaterThan(tag)
expect(script.slice(tag, release)).not.toContain(".nothrow()")
})

test("publish source gates normalize GitHub's case-insensitive repository slug", async () => {
const workflows = ["npm-test.yml", "publish.yml"]

for (const workflow of workflows) {
const source = await Bun.file(path.join(import.meta.dir, `../../../../.github/workflows/${workflow}`)).text()

expect(source).toContain(
'[[ "${GITHUB_REPOSITORY,,}" != "synthetic-sciences/openscience" || "$GITHUB_REF" != "refs/heads/main" ]]',
)
expect(source).not.toContain('[[ "$GITHUB_REPOSITORY" != "synthetic-sciences/OpenScience"')
}
})