Skip to content

Commit 3487008

Browse files
committed
Refactored payload preparation in GitHub Actions workflow to use jq for improved readability and maintainability, ensuring consistent structure for webhook data.
1 parent e98824e commit 3487008

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/docs-to-vector.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ jobs:
1414
- name: Prepare Payload
1515
id: payload
1616
run: |
17-
payload='{"current_commit_id": "${{ github.sha }}", "branch": "${{ github.ref_name }}", "repo_name": "${{ github.event.repository.name }}"}'
17+
payload=$(jq -n \
18+
--arg current_commit_id "${{ github.sha }}" \
19+
--arg repo_name "${{ github.event.repository.name }}" \
20+
'{
21+
current_commit_id: $current_commit_id,
22+
repo_name: $repo_name,
23+
}')
1824
echo "PAYLOAD=$payload" >> $GITHUB_OUTPUT
1925
2026

0 commit comments

Comments
 (0)