cli-patch: generalize to-git functionality with PUSH_TO_GITHUB and PUSH_TO_REPO & enable for u-boot as well as kernel #14762
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Forked Helper | |
on: | |
push: | |
release: | |
deployment: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
fork-repository-dispatch: | |
name: 📢 Run repository dispatch to default fork branch | |
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 }} | |
repository: ${{ github.repository }} | |
event-type: armbian | |
client-payload: > | |
{ | |
"event": "${{ github.event_name }}", | |
"ref": "${{ github.ref }}", | |
"base_ref": "${{ github.base_ref }}", | |
"sha": "${{ github.sha }}", | |
"event_details": ${{ steps.get_event_details.outputs.event_details }} | |
} |