forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 1.2 KB
/
main.yml
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Pull commits into master
on:
#push:
#branches-ignore:
# - 'master'
# - 'dev'
workflow_dispatch:
schedule:
- cron: '1 1 * * 6'
permissions:
contents: write
jobs:
#git config user.name "GitHub Actions Bot"
#git config user.email "<>"
merge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Merge branches
#git config --global user.email "[email protected]"
#git config --global user.name "zorrobert"
run: |
git config user.name 'zorrobert'
git config user.email '[email protected]'
git fetch --all
git checkout master
echo "add https://github.com/NixOS/nixpkgs.git as upstream"
git remote add upstream https://github.com/NixOS/nixpkgs.git
echo "reset master branch to upstream"
git fetch upstream
git reset --hard upstream/master
echo "merge all branches"
git branch --all | sed 's/ remotes\///g' | sed 's/\/master//g' | sed 's/\/dev//g' | sed 's/\/HEAD//g' | grep "origin/" | xargs -L1 git merge
echo "force-push all changes to master"
git push --force
echo "done"