From 7ce4dc8908190ab5e38f81c4bd261d79eee57272 Mon Sep 17 00:00:00 2001 From: SelfhostedPro Date: Fri, 19 Apr 2024 13:33:50 -0700 Subject: [PATCH] Removed excessive processing on the fork-repository-dispatch job You can get the event details directly from the github action environment and also just pass the secret directly into the step. Removed excess steps/processing to simplify the action. https://docs.github.com/en/actions/learn-github-actions/contexts#github-context --- .github/workflows/forked-helper.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/forked-helper.yml b/.github/workflows/forked-helper.yml index b33a6b31d028..15f95f5900d3 100644 --- a/.github/workflows/forked-helper.yml +++ b/.github/workflows/forked-helper.yml @@ -13,23 +13,10 @@ jobs: if: ${{ github.repository_owner != 'armbian' }} runs-on: ubuntu-latest steps: - - name: Assign secret - id: get_dispatch_secret - run: echo 'name=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 "name=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 with: - token: ${{ steps.get_dispatch_secret.outputs.dispatch_secret }} + token: ${{ secrets.ARMBIAN_SELF_DISPATCH_TOKEN }} repository: ${{ github.repository }} event-type: armbian client-payload: > @@ -38,5 +25,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) }} }