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
20 changes: 14 additions & 6 deletions .github/workflows/publish-pub-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,24 @@ jobs:
# Notify in case of failure
- name: Send failure event to PostHog
if: ${{ failure() }}
uses: PostHog/posthog-github-action@58dea254b598fb5d469c0699c98af8288a7f7650 # v1.2.0
continue-on-error: true
uses: PostHog/posthog-github-action@9a6a19d360820ab4d95ecc4a5a7564062c895f84 # v1.3.0
with:
posthog-token: '${{ secrets.POSTHOG_PROJECT_API_KEY }}'
event: 'posthog-flutter-release-workflow-failure'
event: 'posthog-sdk-github-release-workflow-failure'
properties: >-
{
"commitSha": "${{ github.sha }}",
"jobStatus": "${{ job.status }}",
"ref": "${{ github.ref }}",
"packageVersion": "${{ steps.get-version.outputs.version }}"
"repository": "${{ github.repository }}",
"sdk": "posthog-flutter",
"jobName": "publish",
"packageName": "posthog_flutter",
"packageVersion": "${{ steps.get-version.outputs.version || 'unknown' }}",
"actionUrl": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"alertText": ":rotating_light: Failed to publish posthog_flutter@${{ steps.get-version.outputs.version }} to pub.dev :rotating_light:",
"alertContext": "The pub.dev publish workflow failed."
}

- name: Restore Slack thread_ts from cache
Expand All @@ -130,7 +138,7 @@ jobs:
- name: Notify Slack - Failed
continue-on-error: true
if: ${{ failure() && steps.slack-thread-for-failure.outputs.thread_ts != '' }}
uses: PostHog/.github/.github/actions/slack-thread-reply@5fc4680761e8ac29a61b212756230eba0e276d8c
uses: PostHog/.github/.github/actions/slack-thread-reply@cb0979b67dcd585828b61ac45927eef4da8f6287 # main
with:
slack_bot_token: ${{ secrets.SLACK_CLIENT_LIBRARIES_BOT_TOKEN }}
slack_channel_id: ${{ vars.SLACK_APPROVALS_CLIENT_LIBRARIES_CHANNEL_ID }}
Expand Down Expand Up @@ -172,7 +180,7 @@ jobs:
- name: Notify Slack - Released
if: needs.publish.result == 'success'
continue-on-error: true
uses: PostHog/.github/.github/actions/slack-thread-reply@5fc4680761e8ac29a61b212756230eba0e276d8c
uses: PostHog/.github/.github/actions/slack-thread-reply@cb0979b67dcd585828b61ac45927eef4da8f6287 # main
with:
slack_bot_token: ${{ secrets.SLACK_CLIENT_LIBRARIES_BOT_TOKEN }}
slack_channel_id: ${{ vars.SLACK_APPROVALS_CLIENT_LIBRARIES_CHANNEL_ID }}
Expand All @@ -183,7 +191,7 @@ jobs:
- name: Notify Slack - Failed
if: needs.publish.result == 'failure'
continue-on-error: true
uses: PostHog/.github/.github/actions/slack-thread-reply@5fc4680761e8ac29a61b212756230eba0e276d8c
uses: PostHog/.github/.github/actions/slack-thread-reply@cb0979b67dcd585828b61ac45927eef4da8f6287 # main
with:
slack_bot_token: ${{ secrets.SLACK_CLIENT_LIBRARIES_BOT_TOKEN }}
slack_channel_id: ${{ vars.SLACK_APPROVALS_CLIENT_LIBRARIES_CHANNEL_ID }}
Expand Down
28 changes: 25 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
steps:
- name: Notify Slack - Approved
continue-on-error: true
uses: PostHog/.github/.github/actions/slack-thread-reply@5fc4680761e8ac29a61b212756230eba0e276d8c
uses: PostHog/.github/.github/actions/slack-thread-reply@cb0979b67dcd585828b61ac45927eef4da8f6287 # main
with:
slack_bot_token: ${{ secrets.SLACK_CLIENT_LIBRARIES_BOT_TOKEN }}
slack_channel_id: ${{ vars.SLACK_APPROVALS_CLIENT_LIBRARIES_CHANNEL_ID }}
Expand Down Expand Up @@ -160,10 +160,32 @@ jobs:
git tag -a "$NEW_VERSION" -m "$NEW_VERSION"
git push origin "$NEW_VERSION"

- name: Send failure event to PostHog
if: ${{ failure() }}
continue-on-error: true
uses: PostHog/posthog-github-action@9a6a19d360820ab4d95ecc4a5a7564062c895f84 # v1.3.0
with:
posthog-token: '${{ secrets.POSTHOG_PROJECT_API_KEY }}'
event: 'posthog-sdk-github-release-workflow-failure'
properties: >-
{
"commitSha": "${{ github.sha }}",
"jobStatus": "${{ job.status }}",
"ref": "${{ github.ref }}",
"repository": "${{ github.repository }}",
"sdk": "posthog-flutter",
"jobName": "version-bump",
"packageName": "posthog_flutter",
"packageVersion": "${{ steps.apply-changesets.outputs.new-version || 'unknown' }}",
"actionUrl": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"alertText": ":rotating_light: Failed to prepare release posthog_flutter@${{ steps.apply-changesets.outputs.new-version }} :rotating_light:",
"alertContext": "The version bump/changelog step failed before packages were published."
}

- name: Notify Slack - Failed
continue-on-error: true
if: ${{ failure() && needs.notify-approval-needed.outputs.slack_ts != '' }}
uses: PostHog/.github/.github/actions/slack-thread-reply@5fc4680761e8ac29a61b212756230eba0e276d8c
uses: PostHog/.github/.github/actions/slack-thread-reply@cb0979b67dcd585828b61ac45927eef4da8f6287 # main
with:
slack_bot_token: ${{ secrets.SLACK_CLIENT_LIBRARIES_BOT_TOKEN }}
slack_channel_id: ${{ vars.SLACK_APPROVALS_CLIENT_LIBRARIES_CHANNEL_ID }}
Expand Down Expand Up @@ -203,7 +225,7 @@ jobs:
- name: Notify Slack - Rejected
if: steps.check-rejection.outputs.was_rejected == 'true'
continue-on-error: true
uses: PostHog/.github/.github/actions/slack-thread-reply@5fc4680761e8ac29a61b212756230eba0e276d8c
uses: PostHog/.github/.github/actions/slack-thread-reply@cb0979b67dcd585828b61ac45927eef4da8f6287 # main
with:
slack_bot_token: ${{ secrets.SLACK_CLIENT_LIBRARIES_BOT_TOKEN }}
slack_channel_id: ${{ vars.SLACK_APPROVALS_CLIENT_LIBRARIES_CHANNEL_ID }}
Expand Down
Loading