1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
name: "Sync to develop"
on:
workflow_call:
inputs:
sha:
required: true
type: string
workflow_dispatch:
jobs:
sync_branches:
runs-on: ubuntu-latest
concurrency: sync_branches
name: Sync the branch with the default branch (develop)
steps:
- name: Push develop forward (ff only)
shell: sh
run: |
REF="refs/heads/${{ github.event.repository.default_branch }}"
gh api "/repos/${{ github.repository }}/git/$REF" \
--method PATCH \
--header "Accept: application/vnd.github+json" \
--header "X-GitHub-Api-Version: 2022-11-28" \
--raw-field sha='${{ inputs.sha || github.sha }}' \
--field force=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|