-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoverwrite_latest_as_current.yml
More file actions
42 lines (37 loc) · 1.09 KB
/
overwrite_latest_as_current.yml
File metadata and controls
42 lines (37 loc) · 1.09 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
name: Utility - overwrite current folder with latest release
on:
workflow_dispatch:
#schedule:
#- cron: "30 06 11 * *"
jobs:
replace-current:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
token: ${{ secrets.PICOPAT2 }}
fetch-depth: 0
ref: main
- name: Replace current
run: |
LATEST=$(ls -d wikipathways-data-release/* | grep -o '[0-9]\{8\}' | sort -n | tail -1)
rm -rf current
mkdir current
cp -R $LATEST/* current/.
- name: Commit new files
run: |
git config --global user.name 'GitHub Action'
git config --global user.email 'action@github.com'
git add .
if git diff --exit-code --staged; then
echo "No changes"
else
git pull
git commit -m 'New release set to current'
fi
- name: Push as user
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PICOPAT2}}