armbian-build/.github/workflows/forked-helper.yml
dependabot[bot] 1f0993b02c
Bump peter-evans/repository-dispatch from 1 to 2 (#3891)
Bumps [peter-evans/repository-dispatch](https://github.com/peter-evans/repository-dispatch) from 1 to 2.
- [Release notes](https://github.com/peter-evans/repository-dispatch/releases)
- [Commits](https://github.com/peter-evans/repository-dispatch/compare/v1...v2)

---
updated-dependencies:
- dependency-name: peter-evans/repository-dispatch
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-11 18:16:04 +02:00

43 lines
1.5 KiB
YAML

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 '::set-output name=dispatch_secret::${{ secrets.ARMBIAN_SELF_DISPATCH_TOKEN }}'
- name: Get event details
id: get_event_details
# Process JSON according https://github.community/t5/GitHub-Actions/set-output-Truncates-Multiline-Strings/td-p/37870
run: |
JSON=$(cat ${{ github.event_path }})
JSON="${JSON//'%'/'%25'}"
JSON="${JSON//$'\n'/'%0A'}"
JSON="${JSON//$'\r'/'%0D'}"
echo "::set-output name=event_details::${JSON}"
- name: Dispatch event on forked repostitory
if: steps.get_dispatch_secret.outputs.dispatch_secret
uses: peter-evans/repository-dispatch@v2
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 }}
}