Update render-README.yml #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check and Copy Updated Files | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
check-and-copy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
ssh-key: ${{ secrets.RENDER_KEY }} | |
#persist-credentials: false | |
- name: Parse File List from release/README.qmd | |
id: parse | |
run: | | |
# Navigate to the release folder | |
cd software | |
cd release | |
# Extract the table section and parse the file paths | |
raw_file_list=$(awk '/\| name/ {f=1; next} /\|----/ {next} f && /\|/ {print $2}' README.qmd | tr -d ' ') | |
# Add the software/ prefix to each file path | |
echo "$raw_file_list" | sed 's/^/software\//' > file_list.txt | |
# Debugging output | |
echo "Files to monitor:" | |
cat file_list.txt | |
- name: Copy Files to Release Folder | |
run: | | |
mkdir -p release # Ensure the release folder exists | |
while read file; do | |
cp "$file" release/ # Copy files directly to the root of the release folder | |
done < release/file_list.txt | |
- name: List Files in Release Folder | |
run: | | |
echo "Files copied to the release folder:" | |
find release -type f | |
- name: Commit and Push Changes | |
run: | | |
# Configure Git | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
# Add, commit and push changes | |
git add release/ | |
git commit -m "Copy updated files to the release folder" | |
git fetch origin | |
git push origin main | |
env: | |
GITHUB_TOKEN: ${{ secrets.RENDER_KEY }} |