Skip to content

: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.

fix(ci): avoid canceled skills releases (#66396)

Raúl Negrón-Oteroca6f8b0827ae
diff --git a/.github/workflows/ci-agent-skills.yml b/.github/workflows/ci-agent-skills.yml
index a30f77dbda43..984c77afa6e4 100644
--- a/.github/workflows/ci-agent-skills.yml
+++ b/.github/workflows/ci-agent-skills.yml
@@ -11,8 +11,8 @@ on:
- master
concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
- cancel-in-progress: true
+ group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.sha || github.head_ref || github.ref }}
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
DOCKERHUB_USERNAME: ${{ vars.DOCKERHUB_USER }}
@@ -135,12 +135,39 @@ jobs:
DEBUG: 1
run: ./bin/hogli build:skills
+ current-master:
+ name: Check current master
+ runs-on: ubuntu-latest
+ timeout-minutes: 5
+ needs: check-skills
+ if: github.repository_owner == 'PostHog' && github.ref == 'refs/heads/master'
+ outputs:
+ is-current: ${{ steps.current-master.outputs.is_current }}
+ permissions:
+ contents: read
+
+ steps:
+ - name: Check current master
+ id: current-master
+ env:
+ GIT_SHA: ${{ github.sha }}
+ REPOSITORY: ${{ github.repository }}
+ run: |
+ REMOTE_MASTER=$(git ls-remote "https://github.com/${REPOSITORY}.git" refs/heads/master || true)
+ CURRENT_MASTER=$(printf '%s\n' "$REMOTE_MASTER" | awk '{print $1}')
+ if [ "$CURRENT_MASTER" = "$GIT_SHA" ]; then
+ echo "is_current=true" >> "$GITHUB_OUTPUT"
+ else
+ echo "is_current=false" >> "$GITHUB_OUTPUT"
+ echo "Skipping agent skills release for stale master SHA $GIT_SHA"
+ fi
+
release-skills:
name: Release agent skills
runs-on: ubuntu-latest
timeout-minutes: 30
- needs: check-skills
- if: github.ref == 'refs/heads/master'
+ needs: [check-skills, current-master]
+ if: github.repository_owner == 'PostHog' && github.ref == 'refs/heads/master' && needs.current-master.outputs.is-current == 'true'
permissions:
contents: write