:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(ci): sign all commits performed via CI (#60366)
Tom Piccirello6ded8300863d
diff --git a/.github/workflows/browserslist.yml b/.github/workflows/browserslist.ymlindex c1953922fefc..f39fbbf3660f 100644--- a/.github/workflows/browserslist.yml+++ b/.github/workflows/browserslist.yml@@ -27,11 +27,6 @@ jobs:with:token: ${{ steps.app-token.outputs.token }}- - name: Configure git- run: |- git config --global user.email "[email protected]"- git config --global user.name "Browserslist Update Action"-- name: Install pnpmuses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0@@ -44,31 +39,83 @@ jobs:node-version-file: .nvmrccache: 'pnpm'- - name: Reset stale browserslist branch+ - name: Update Browserslist database+ env:+ NO_COLOR: '1'+ run: |+ pnpm install+ npx --yes update-browserslist-db@latest 2>&1 | tee /tmp/browserslist-output.txt++ - name: Check for changes+ id: check-changes+ run: |+ if git diff --quiet pnpm-lock.yaml; then+ echo "changes=false" >> $GITHUB_OUTPUT+ echo "No Browserslist updates available"+ else+ echo "changes=true" >> $GITHUB_OUTPUT+ git diff --stat pnpm-lock.yaml+ fi++ - name: Build PR body+ if: steps.check-changes.outputs.changes == 'true'+ run: |+ {+ echo "Automated weekly update of the Browserslist database (\`caniuse-lite\`)."+ echo+ echo '```'+ cat /tmp/browserslist-output.txt+ echo '```'+ } > /tmp/pr-body.md++ - name: Reset branch to checked-out SHA+ if: steps.check-changes.outputs.changes == 'true'env:GH_TOKEN: ${{ steps.app-token.outputs.token }}+ TARGET_SHA: ${{ github.sha }}run: |- if git ls-remote --heads origin browserslist-update | grep browserslist-update; then- echo "Resetting stale browserslist-update branch to master to avoid rebase conflicts"- git fetch origin browserslist-update- git checkout -b browserslist-update origin/browserslist-update- git reset --hard origin/master- git push origin browserslist-update --force- git checkout master+ if gh api repos/${{ github.repository }}/git/ref/heads/browserslist-update >/dev/null 2>&1; then+ gh api -X PATCH repos/${{ github.repository }}/git/refs/heads/browserslist-update \+ -f sha="$TARGET_SHA" -F force=true+ else+ gh api repos/${{ github.repository }}/git/refs -f ref=refs/heads/browserslist-update -f sha="$TARGET_SHA"fi- - name: Update Browserslist database and create PR if applies- id: update-browserlist- uses: c2corg/browserslist-update-action@a76abb476199caea5399f9e28ff3f16e491ec566 # v2.5.0+ - name: Commit+ if: steps.check-changes.outputs.changes == 'true'+ uses: planetscale/ghcommit-action@25309d8005ac7c3bcd61d3fe19b69e0fe47dbdde # v0.2.20with:- github_token: ${{ steps.app-token.outputs.token }}commit_message: 'build: update Browserslist db'- title: 'build: update Browserslist db'- labels: 'dependencies'+ repo: ${{ github.repository }}+ branch: browserslist-update+ file_pattern: 'pnpm-lock.yaml'+ env:+ GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}++ - name: Create or update pull request+ id: pr+ if: steps.check-changes.outputs.changes == 'true'+ env:+ GH_TOKEN: ${{ steps.app-token.outputs.token }}+ run: |+ existing_pr=$(gh pr list --head "browserslist-update" --json number --jq '.[0].number' 2>/dev/null || true)+ if [ -n "$existing_pr" ]; then+ gh pr edit "$existing_pr" --body-file /tmp/pr-body.md+ echo "pr_number=$existing_pr" >> $GITHUB_OUTPUT+ else+ pr_url=$(gh pr create \+ --title "build: update Browserslist db" \+ --body-file /tmp/pr-body.md \+ --base master \+ --head browserslist-update \+ --label "dependencies")+ echo "pr_number=$(basename "$pr_url")" >> $GITHUB_OUTPUT+ fi- name: Enable automerge+ if: steps.check-changes.outputs.changes == 'true'env:GH_TOKEN: ${{ steps.app-token.outputs.token }}- PR_NUMBER: ${{ steps.update-browserlist.outputs.pr_number }}+ PR_NUMBER: ${{ steps.pr.outputs.pr_number }}run: |gh pr merge "$PR_NUMBER" --auto --squashdiff --git a/.github/workflows/build-hogql-parser-npm.yml b/.github/workflows/build-hogql-parser-npm.ymlindex c2a0348e2d4a..5549b8bd4900 100644--- a/.github/workflows/build-hogql-parser-npm.yml+++ b/.github/workflows/build-hogql-parser-npm.yml@@ -164,12 +164,23 @@ jobs:sleep 0.5done- - uses: EndBug/add-and-commit@290ea2c423ad77ca9c62ae0f5b224379612c0321 # v10.0.0+ - name: Check for pin changes+ id: check-pin+ shell: bash+ run: |+ if git diff --quiet frontend/package.json pnpm-lock.yaml; then+ echo "changed=false" >> $GITHUB_OUTPUT+ else+ echo "changed=true" >> $GITHUB_OUTPUT+ fi++ - name: Commit pin+ if: steps.check-pin.outputs.changed == 'true'+ uses: planetscale/ghcommit-action@25309d8005ac7c3bcd61d3fe19b69e0fe47dbdde # v0.2.20with:- add: |- frontend/package.json- pnpm-lock.yaml- commit: '--no-verify'- message: 'Use new @posthog/hogql-parser npm version'- default_author: github_actions- github_token: ${{ steps.app-token.outputs.token }}+ commit_message: 'Use new @posthog/hogql-parser npm version'+ repo: ${{ github.repository }}+ branch: ${{ github.event.pull_request.head.ref }}+ file_pattern: 'frontend/package.json pnpm-lock.yaml'+ env:+ GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}diff --git a/.github/workflows/build-hogql-parser-rs.yml b/.github/workflows/build-hogql-parser-rs.ymlindex 272d16e65472..b095b60b9391 100644--- a/.github/workflows/build-hogql-parser-rs.yml+++ b/.github/workflows/build-hogql-parser-rs.yml@@ -223,27 +223,38 @@ jobs:sleep 0.5done- - uses: EndBug/add-and-commit@290ea2c423ad77ca9c62ae0f5b224379612c0321 # v10.0.0- id: commit-pin+ - name: Check for pin changes+ id: check-pin+ shell: bash+ run: |+ if git diff --quiet pyproject.toml uv.lock; then+ echo "changed=false" >> $GITHUB_OUTPUT+ else+ echo "changed=true" >> $GITHUB_OUTPUT+ fi++ - name: Commit pin+ if: steps.check-pin.outputs.changed == 'true'+ uses: planetscale/ghcommit-action@25309d8005ac7c3bcd61d3fe19b69e0fe47dbdde # v0.2.20with:- add: |- pyproject.toml- uv.lock- message: 'Use new hogql-parser-rs version'- default_author: github_actions- github_token: ${{ steps.app-token.outputs.token }}+ commit_message: 'Use new hogql-parser-rs version'+ repo: ${{ github.repository }}+ branch: ${{ github.event.pull_request.head.ref }}+ file_pattern: 'pyproject.toml uv.lock'+ env:+ GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}- name: Verify pin is consistent with the published versionshell: bashenv:- PUSHED: ${{ steps.commit-pin.outputs.pushed }}+ CHANGED: ${{ steps.check-pin.outputs.changed }}VERSION: ${{ needs.check-version.outputs.local-version }}run: |# The commit step is a no-op when pyproject.toml + uv.lock were already# pre-bumped on the branch to the version we just published — fine.# Verify the pin is consistent with the published version (i.e. the# branch is in a deployable state) before declaring success.- if [[ "$PUSHED" != "true" ]]; then+ if [[ "$CHANGED" != "true" ]]; thenpinned=$(grep -m1 'hogql-parser-rs==' pyproject.toml | sed -E 's/.*hogql-parser-rs==([^"]*).*/\1/')if [[ "$pinned" != "$VERSION" ]]; thenecho "::error::hogql-parser-rs published to PyPI as $VERSION but pyproject.toml pin says $pinned."diff --git a/.github/workflows/build-hogql-parser.yml b/.github/workflows/build-hogql-parser.ymlindex a410f2588f01..083f27d59989 100644--- a/.github/workflows/build-hogql-parser.yml+++ b/.github/workflows/build-hogql-parser.yml@@ -210,22 +210,33 @@ jobs:sleep 0.5done- - uses: EndBug/add-and-commit@290ea2c423ad77ca9c62ae0f5b224379612c0321 # v10.0.0- id: commit-pin+ - name: Check for pin changes+ id: check-pin+ shell: bash+ run: |+ if git diff --quiet pyproject.toml uv.lock; then+ echo "changed=false" >> $GITHUB_OUTPUT+ else+ echo "changed=true" >> $GITHUB_OUTPUT+ fi++ - name: Commit pin+ if: steps.check-pin.outputs.changed == 'true'+ uses: planetscale/ghcommit-action@25309d8005ac7c3bcd61d3fe19b69e0fe47dbdde # v0.2.20with:- add: |- pyproject.toml- uv.lock- message: 'Use new hogql-parser version'- default_author: github_actions- github_token: ${{ steps.app-token.outputs.token }}+ commit_message: 'Use new hogql-parser version'+ repo: ${{ github.repository }}+ branch: ${{ github.event.pull_request.head.ref }}+ file_pattern: 'pyproject.toml uv.lock'+ env:+ GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}- name: Fail if pin update produced no commitshell: bashenv:- PUSHED: ${{ steps.commit-pin.outputs.pushed }}+ CHANGED: ${{ steps.check-pin.outputs.changed }}run: |- if [[ "$PUSHED" != "true" ]]; then+ if [[ "$CHANGED" != "true" ]]; thenecho "::error::hogql-parser wheel was published to PyPI but pyproject.toml pin was not updated."echo "Check the 'Update hogql-parser in requirements' step above for why uv add did not produce a diff."exit 1