mirror of
https://github.com/chenasraf/sofmani.git
synced 2026-05-17 17:28:04 +00:00
build: include PR body in tap release
This commit is contained in:
20
.github/workflows/manual-homebrew-release.yml
vendored
20
.github/workflows/manual-homebrew-release.yml
vendored
@@ -15,12 +15,19 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Get latest tag
|
- name: Get latest release info
|
||||||
id: latest
|
id: latest
|
||||||
run: |
|
run: |
|
||||||
tag=$(gh release view --json tagName -q .tagName)
|
tag=$(gh release view --json tagName -q .tagName)
|
||||||
echo "Latest release tag: $tag"
|
echo "Latest release tag: $tag"
|
||||||
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
# Get release body and escape for JSON
|
||||||
|
body=$(gh release view --json body -q .body)
|
||||||
|
# Use delimiter for multiline output
|
||||||
|
echo "body<<EOF" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "$body" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "EOF" >> "$GITHUB_OUTPUT"
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
@@ -30,7 +37,16 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
tag="${{ steps.latest.outputs.tag }}"
|
tag="${{ steps.latest.outputs.tag }}"
|
||||||
repo="${{ github.event.repository.name }}"
|
repo="${{ github.event.repository.name }}"
|
||||||
data="{\"event_type\":\"trigger-from-release\",\"client_payload\":{\"tag\":\"$tag\",\"repo\":\"$repo\"}}"
|
# Use jq to properly escape the body for JSON
|
||||||
|
body=$(cat <<'BODY_EOF'
|
||||||
|
${{ steps.latest.outputs.body }}
|
||||||
|
BODY_EOF
|
||||||
|
)
|
||||||
|
data=$(jq -n \
|
||||||
|
--arg tag "$tag" \
|
||||||
|
--arg repo "$repo" \
|
||||||
|
--arg body "$body" \
|
||||||
|
'{event_type: "trigger-from-release", client_payload: {tag: $tag, repo: $repo, body: $body}}')
|
||||||
echo "Dispatching tag $tag from $repo"
|
echo "Dispatching tag $tag from $repo"
|
||||||
echo "Data: $data"
|
echo "Data: $data"
|
||||||
curl -X POST \
|
curl -X POST \
|
||||||
|
|||||||
20
.github/workflows/release.yml
vendored
20
.github/workflows/release.yml
vendored
@@ -106,13 +106,31 @@ jobs:
|
|||||||
if: ${{ needs.release-please.outputs.release_created }}
|
if: ${{ needs.release-please.outputs.release_created }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Get release body
|
||||||
|
id: release-body
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
body=$(gh release view "${{ needs.release-please.outputs.tag_name }}" --repo "${{ github.repository }}" --json body -q .body)
|
||||||
|
echo "body<<EOF" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "$body" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "EOF" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Send dispatch to homebrew-tap
|
- name: Send dispatch to homebrew-tap
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.REPO_DISPATCH_PAT }}
|
GH_TOKEN: ${{ secrets.REPO_DISPATCH_PAT }}
|
||||||
run: |
|
run: |
|
||||||
repo="${{ github.event.repository.name }}"
|
repo="${{ github.event.repository.name }}"
|
||||||
tag="${{ needs.release-please.outputs.tag_name }}"
|
tag="${{ needs.release-please.outputs.tag_name }}"
|
||||||
data="{\"event_type\":\"trigger-from-release\",\"client_payload\":{\"tag\":\"$tag\",\"repo\":\"$repo\"}}"
|
body=$(cat <<'BODY_EOF'
|
||||||
|
${{ steps.release-body.outputs.body }}
|
||||||
|
BODY_EOF
|
||||||
|
)
|
||||||
|
data=$(jq -n \
|
||||||
|
--arg tag "$tag" \
|
||||||
|
--arg repo "$repo" \
|
||||||
|
--arg body "$body" \
|
||||||
|
'{event_type: "trigger-from-release", client_payload: {tag: $tag, repo: $repo, body: $body}}')
|
||||||
echo "Dispatching tag $tag from $repo"
|
echo "Dispatching tag $tag from $repo"
|
||||||
echo "Data: $data"
|
echo "Data: $data"
|
||||||
curl -X POST \
|
curl -X POST \
|
||||||
|
|||||||
Reference in New Issue
Block a user