Generate index.md files #18
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: 'Generate index.md files' | |
on: | |
push: # Runs on pushes targeting the default branch | |
branches: ["master"] | |
# Trigger on changes to all "README.md" files | |
paths: ['**/README.md'] | |
workflow_dispatch: # Allow manual triggering | |
jobs: | |
modify-links: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
steps: | |
- name: 'Checkout Repository' | |
uses: 'actions/checkout@v4' | |
with: | |
repository: ${{ github.repository }} | |
token: ${{ secrets.TOKEN }} | |
- name: 'Create index.md files' | |
shell: bash | |
run: | | |
echo "\$PATH: $PATH" | |
cp -v ./scripts/create-index.md-files . | |
chmod +x ./create-index.md-files | |
exec ./create-index.md-files | |
- name: 'Commit changes' | |
shell: bash | |
run: | | |
git config --local user.name 'github-actions[bot]' | |
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
git add -A | |
current_time=$(date +'%Y-%m-%d %H:%M:%S') | |
git commit -a -m "Created/Updated \`index.md\` files at $current_time" | |
- name: 'Push changes' | |
uses: 'ad-m/[email protected]' | |
with: | |
github_token: ${{ secrets.TOKEN }} | |
branch: ${{ github.ref }} | |