forked from theochem/AtomDBdata
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1.28 KB
/
repo_data.yaml
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
name: repodata
on:
push:
branches:
- main
pull_request:
jobs:
generate_repodata:
runs-on: ubuntu-latest
name: Generate repodata.txt on data folders
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Generate repodata.txt msg databases
run: |
# Define the function within the workflow
compute_msg_sha256() {
# $1 is the folder to compute sha256
# $2 is the file extension to compute sha256
old_pwd=$(pwd)
cd $1
for file in $(ls *"$2"| sort); do
sha256sum "$file"
done
cd $old_pwd
}
# Call the function to generate repodata.txt
compute_msg_sha256 "slater/db" ".msg" > slater/db/repodata.txt
- name: Commit changes
run: |
# Configure Git user details
git config --global user.email "[email protected]"
git config --global user.name "database-bot"
# Add the repodata.txt file
git add slater/db/repodata.txt
# Commit the changes
git commit -m "Update repodata.txt"
# Push the changes to the repository
git push origin main