-
Notifications
You must be signed in to change notification settings - Fork 41
59 lines (48 loc) · 1.62 KB
/
Copy pathpullFromGEE.yaml
File metadata and controls
59 lines (48 loc) · 1.62 KB
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
name: Sync from GEE
on:
workflow_dispatch:
permissions:
contents: write
concurrency:
group: gee-sync
cancel-in-progress: false
defaults:
run:
shell: bash
jobs:
mirror:
name: Pull GEE changes into GitHub
runs-on: ubuntu-latest
timeout-minutes: 20
env:
GEE_REPO_ADDRESS: ${{ secrets.GEE_REPO_ADDRESS }}
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Configure Git and GEE authentication
env:
GIT_COOKIE_VALUE: ${{ secrets.GIT_COOKIE_VALUE }}
run: |
set -euo pipefail
: "${GIT_COOKIE_VALUE:?GIT_COOKIE_VALUE secret is required}"
: "${GEE_REPO_ADDRESS:?GEE_REPO_ADDRESS secret is required}"
touch ~/.gitcookies
chmod 0600 ~/.gitcookies
printf 'earthengine.googlesource.com\tFALSE\t/\tTRUE\t2147483647\to\t%s\n' "${GIT_COOKIE_VALUE}" > ~/.gitcookies
git config http.cookiefile ~/.gitcookies
git config http.postBuffer 157286400
git config user.email "githubActionAutoMerge@no-one.com"
git config user.name "githubActionAutoMerge"
git config pull.rebase false
- name: Mirror repository from GEE
run: |
set -euo pipefail
git pull "https://earthengine.googlesource.com/${GEE_REPO_ADDRESS}" master --allow-unrelated-histories || {
git checkout --theirs .
git add -u
git commit -m "autoMerge"
}
git push "https://earthengine.googlesource.com/${GEE_REPO_ADDRESS}" master
git push origin HEAD:master