Skip to content

Commit 30f9c15

Browse files
committed
Add caching mechanism for GitHub repo files in build_packages_info.yml
1 parent f8d19fb commit 30f9c15

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/build_packages_info.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ jobs:
2626
echo $GITHUB_WORKSPACE
2727
ls $GITHUB_WORKSPACE
2828
29+
# Make a cache directory for some info from the GitHub clones.
30+
mkdir cache
31+
2932
# Create new output file
3033
echo "Name,Description,CRAN link,CRAN version, CRAN license,Last commit,GitHub version,GitHub license,Github owner,Status" > output.csv
3134
@@ -116,8 +119,15 @@ jobs:
116119
gh_code_of_conduct=$(cat gh_repo_info.json | jq '.codeOfConduct.name')
117120
echo "GitHub code of conduct: $gh_code_of_conduct"
118121

119-
# Tidy up
122+
# Keep some files for processing later
120123
cd ..
124+
mkdir cache/$gh_repo_name
125+
cp $gh_repo_name/DESCRIPTION cache/$gh_repo_name/
126+
cp $gh_repo_name/NAMESPACE cache/$gh_repo_name/ 2>/dev/null || true
127+
cp $gh_repo_name/README.md cache/$gh_repo_name/ 2>/dev/null || true
128+
cp $gh_repo_name/LICENSE* cache/$gh_repo_name/ 2>/dev/null || true
129+
130+
# tidy up
121131
rm -rf $gh_repo_name
122132
fi
123133

@@ -176,6 +186,7 @@ jobs:
176186
run: |
177187
python3 web_pages/build_packages_page.py
178188
mv output/* gh-pages/
189+
mv cache/* gh-pages/
179190
180191
- name: Upload static files as artifact
181192
id: deployment

0 commit comments

Comments
 (0)