Skip to content
Merged
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
19 changes: 15 additions & 4 deletions .github/workflows/post-release-to-x.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
name: Post Release to X

on:
release:
types: [published]
workflow_run:
workflows: ["Release"]
types: [completed]
workflow_dispatch:

jobs:
notify:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conditional check will prevent this workflow from running when triggered via workflow_dispatch, since github.event.workflow_run will be null for manual triggers. Consider adding an additional condition to allow manual runs. For example: if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}

Suggested change
if: ${{ github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}

Copilot uses AI. Check for mistakes.
steps:
- name: Get latest release
id: release
run: |
RELEASE=$(gh api /repos/${{ github.repository }}/releases/latest)
echo "tag=$(echo $RELEASE | jq -r .tag_name)" >> $GITHUB_OUTPUT
echo "url=$(echo $RELEASE | jq -r .html_url)" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Tweet new release
Comment on lines +17 to 23
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow will trigger when the "Release" workflow completes, but the "Release" workflow has continue-on-error: true on the changesets action (release.yml:52). This means the post-release workflow could run even if no release was actually created. Consider adding error handling in the "Get latest release" step to handle cases where the API call fails, such as when no releases exist yet.

Suggested change
RELEASE=$(gh api /repos/${{ github.repository }}/releases/latest)
echo "tag=$(echo $RELEASE | jq -r .tag_name)" >> $GITHUB_OUTPUT
echo "url=$(echo $RELEASE | jq -r .html_url)" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Tweet new release
if ! RELEASE=$(gh api /repos/${{ github.repository }}/releases/latest 2>/dev/null); then
echo "No GitHub release found; skipping notification."
echo "tag=" >> "$GITHUB_OUTPUT"
echo "url=" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "tag=$(echo "$RELEASE" | jq -r .tag_name)" >> "$GITHUB_OUTPUT"
echo "url=$(echo "$RELEASE" | jq -r .html_url)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Tweet new release
if: ${{ steps.release.outputs.tag != '' }}

Copilot uses AI. Check for mistakes.
uses: nearform-actions/github-action-notify-twitter@v1
with:
message: |
Evolution SDK ${{ github.event.release.tag_name }} out now
${{ github.event.release.html_url }}
Evolution SDK ${{ steps.release.outputs.tag }} out now
${{ steps.release.outputs.url }}
Happy building! 🛠️
twitter-app-key: ${{ secrets.TWITTER_API_KEY }}
twitter-app-secret: ${{ secrets.TWITTER_API_SECRET }}
Expand Down