Update orphan.yml #4
Workflow file for this run
This file contains hidden or 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: generate empty branch | |
on: | |
repository_dispatch: | |
workflow_dispatch: | |
push: | |
branches: orphan | |
jobs: | |
empty_branch: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: firmware | |
- name: Create new empty firmware branch | |
run: | | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config user.name "github-actions[bot]" | |
git switch --orphan new_branch # create empty branch | |
git commit --allow-empty -m "Initial commit" | |
git push -u origin new_branch # push empty branch in repo | |
git switch firmware | |
git reset --hard new_branch # reset firmware branch | |
git push origin firmware -f | |
git push origin --delete new_branch # delete empty_branch |