-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (66 loc) · 1.97 KB
/
automatic-pr-to-dash-copy.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Copy loopy-dash.el to other branch.
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
permissions:
contents: write
jobs:
copy_file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master
path: loopy-master
- uses: actions/checkout@v3
with:
ref: loopy-dash-only
path: loopy-dash-only
- uses: actions/checkout@v3
with:
ref: loopy-only
path: loopy-only
- name: Copy commit message
run: |
cd loopy-master
git log \
--format='(GitHub Action) %s%n%nThis commit was copied from the master branch.%n%nCommit: %H%nAuthor: %an <%ae>%nDate: %ai%n%n%B' \
-n 1 --no-color --encoding=utf8 HEAD > ../commit-msg.txt
cd ..
- name: Copy file "loopy-dash.el" to directory "loopy-dash-only"
run: cp loopy-master/loopy-dash.el loopy-dash-only/loopy-dash.el
- name: Commit new changes and push for loopy-dash-only.
run: |
cd loopy-dash-only
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add --force loopy-dash.el
git commit --allow-empty -F ../commit-msg.txt
git push
cd ..
env:
USERNAME: github-actions[bot]
- name: Copy all other files to directory "loopy-only"
run: |
shopt -u dotglob
cd loopy-master
rm -rf .git*/**
rm loopy-seq.el
cp -t ../loopy-only -r **
cd ..
- name: Commit new changes and push for loopy-only.
run: |
cd loopy-only
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add --force .
git commit --allow-empty -F ../commit-msg.txt
git push
env:
USERNAME: github-actions[bot]