From 28e859f7ce0ef891ad944fda8a0291e9fe2d5f5a Mon Sep 17 00:00:00 2001 From: ColorfulRhino <131405023+ColorfulRhino@users.noreply.github.com> Date: Thu, 18 Jul 2024 02:00:31 +0200 Subject: [PATCH] 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. --- .github/workflows/forked-helper.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/forked-helper.yml b/.github/workflows/forked-helper.yml index 8fd61cd1e5..b00d7e5d95 100644 --- a/.github/workflows/forked-helper.yml +++ b/.github/workflows/forked-helper.yml @@ -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) }} }