actions: forked-helper: Don't escape multiline strings

Not needed anymore with GITHUB_OUTPUT.
See https://github.com/orgs/community/discussions/26288#discussioncomment-3876281

Instead, use the `toJSON` function that Actions offers to convert the `event` object to JSON.
This commit is contained in:
ColorfulRhino
2024-07-18 02:00:31 +02:00
committed by Igor
parent 7e9adb3811
commit 28e859f7ce

View File

@@ -18,16 +18,6 @@ jobs:
id: get_dispatch_secret
run: echo "dispatch_secret=${{ secrets.ARMBIAN_SELF_DISPATCH_TOKEN }}" >> $GITHUB_OUTPUT
- name: Get event details
id: get_event_details
# Process JSON according https://github.com/orgs/community/discussions/26288
run: |
JSON=$(cat ${{ github.event_path }})
JSON="${JSON//'%'/'%25'}"
JSON="${JSON//$'\n'/'%0A'}"
JSON="${JSON//$'\r'/'%0D'}"
echo "event_details=${JSON}" >> $GITHUB_OUTPUT
- name: Dispatch event on forked repostitory
if: steps.get_dispatch_secret.outputs.dispatch_secret
uses: peter-evans/repository-dispatch@v3
@@ -41,5 +31,5 @@ jobs:
"ref": "${{ github.ref }}",
"base_ref": "${{ github.base_ref }}",
"sha": "${{ github.sha }}",
"event_details": ${{ steps.get_event_details.outputs.event_details }}
"event_details": ${{ toJSON(github.event) }}
}