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
38 changes: 12 additions & 26 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
build-and-test:
runs-on: ubuntu-latest
permissions:
contents: write # only used by the post-merge baseline refresh step below
contents: write # push the baseline branch for the post-merge PR below
pull-requests: write # open the post-merge baseline-refresh PR

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -66,31 +67,16 @@ jobs:
- name: Quality gate
run: ./scripts/quality-gate/gate.sh packages ${{ github.event_name == 'pull_request' && '--bypass-format' || '--overwrite-baseline' }}

# Commit the new baseline back to master. always() so an improvement still
# lands even if a later stage failed — a coverage/warning gain is orthogonal to,
# say, a flaky E2E. Only runs on push (PRs are read-only, nothing to commit).
#
# format-master.yml fires on the same merge and also pushes to master, so this
# push can lose a race; fetch+rebase+retry rather than clobber. The push uses the
# default GITHUB_TOKEN, whose pushes don't trigger another workflow run, so this
# can't loop back into itself.
- name: Refresh baseline on master
if: always() && github.event_name == 'push'
run: |
if ! git status --porcelain -- 'packages/*/.gate-baseline.json' | grep -q .; then
echo "no baseline change"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -- 'packages/*/.gate-baseline.json'
git commit -m "chore(quality-gate): refresh baseline after merge"
for attempt in 1 2 3 4 5; do
if git push origin HEAD:master; then exit 0; fi
echo "push rejected (attempt $attempt) — rebasing onto latest master and retrying"
git fetch origin master
git rebase origin/master || { git rebase --abort; exit 1; }
done
echo "could not push baseline after retries" >&2
exit 1
uses: peter-evans/create-pull-request@v7
with:
add-paths: packages/*/.gate-baseline.json
base: master
branch: automation/refresh-baseline
delete-branch: true
commit-message: "chore(quality-gate): refresh baseline after merge"
title: "chore(quality-gate): refresh baseline after merge"
body: |
Refreshes the quality-gate baseline after a merge to master.

25 changes: 13 additions & 12 deletions .github/workflows/format-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:
if: github.event.head_commit.author.email != 'github-actions[bot]@users.noreply.github.com'
runs-on: ubuntu-latest
permissions:
contents: write
contents: write # push the format branch for the PR below
pull-requests: write # open the auto-format PR

steps:
- uses: actions/checkout@v4
Expand All @@ -42,14 +43,14 @@ jobs:
fi
./scripts/quality-gate/format-suggest.sh packages --base-ref "$before"

- name: Commit and push if anything changed
run: |
if git status --porcelain -- '*.cs' | grep -q .; then
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -- '*.cs'
git commit -m "chore(format): auto-format after merge"
git push origin HEAD:master
else
echo "nothing to format"
fi
- name: Open PR with formatting fix
uses: peter-evans/create-pull-request@v7
with:
add-paths: "*.cs"
base: master
branch: automation/format-master
delete-branch: true
commit-message: "chore(format): auto-format after merge"
title: "chore(format): auto-format after merge"
body: |
Applies `dotnet format` to files changed by the last merge to master.
34 changes: 14 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

publish:
needs: release-please
if: ${{ github.repository_owner == 'supabase-community' && (needs.release-please.outputs.releases_created == 'true'|| github.event_name == 'workflow_dispatch') }}
if: ${{ github.repository_owner == 'supabase' && (needs.release-please.outputs.releases_created == 'true'|| github.event_name == 'workflow_dispatch') }}
name: build, pack & publish
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -68,11 +68,12 @@ jobs:

mark-api-shipped:
needs: [release-please, publish]
if: ${{ github.repository_owner == 'supabase-community' && (needs.release-please.outputs.releases_created == 'true'|| github.event_name == 'workflow_dispatch') }}
if: ${{ github.repository_owner == 'supabase' && (needs.release-please.outputs.releases_created == 'true'|| github.event_name == 'workflow_dispatch') }}
name: mark public API shipped
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -81,21 +82,14 @@ jobs:
- name: Fold Unshipped API into Shipped
run: ./scripts/quality-gate/mark-api-shipped.sh packages

- name: Commit shipped API to master
run: |
if ! git status --porcelain -- 'packages/*/PublicAPI.*.txt' | grep -q .; then
echo "no public API to ship"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -- 'packages/*/PublicAPI.*.txt'
git commit -m "chore(quality-gate): mark public API shipped after release"
for attempt in 1 2 3 4 5; do
if git push origin HEAD:master; then exit 0; fi
echo "push rejected (attempt $attempt) — rebasing onto latest master and retrying"
git fetch origin master
git rebase origin/master || { git rebase --abort; exit 1; }
done
echo "could not push shipped API after retries" >&2
exit 1
- name: Open PR to mark shipped API
uses: peter-evans/create-pull-request@v7
with:
add-paths: packages/*/PublicAPI.*.txt
base: master
branch: automation/mark-api-shipped
delete-branch: true
commit-message: "chore(quality-gate): mark public API shipped after release"
title: "chore(quality-gate): mark public API shipped after release"
body: |
Folds Unshipped public API into Shipped after release ${{ needs.release-please.outputs.tag_name }}.
Loading