This repository was archived by the owner on Nov 2, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Synchronize the example with the template
2+ on :
3+ schedule :
4+ # every hour
5+ - cron : " 0 * * * *"
6+
7+ jobs :
8+ remind_token :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : install cargo generate
12+ uses : actions-rs/install@v0.1
13+ with :
14+ crate : cargo-generate
15+ version : latest
16+
17+ - name : Create new example
18+ run : |
19+ cargo generate --git https://github.com/rust-github/template.git --name rust-gh-example
20+ cd rust-gh-example
21+
22+ - name : replace username
23+ run : |
24+ sed -i 's#{\[username\]}#MyUsername#g' $(find . -type f -name '*.md' -o -name '*.yml' -o -name '*.toml')
25+ cd ..
26+
27+ - name : Checkout old example
28+ uses : actions/checkout@v2
29+ with :
30+ repository : rust-github/rust-gh-example
31+ path : old_example
32+
33+ - name : move sources from old to new example
34+ run : |
35+ rm rust-gh-example/src/main.rs
36+ cp old_example/src/* rust-gh-example/src/
37+
38+ - name : update example
39+ run : |
40+ cd old_example
41+ git config user.name github-actions
42+ git config user.email github-actions@github.com
43+ git add .
44+ if [ -n "$(git status --porcelain)" ]; then
45+ git commit -m "automatic update" -m "from $GITHUB_REPOSITORY@$GITHUB_SHA"
46+ git push
47+ else
48+ echo "nothing to commit";
49+ fi
You can’t perform that action at this time.
0 commit comments