mirror of
https://github.com/minoplhy/deployment.git
synced 2025-04-21 10:46:56 +00:00
readme-generate.yaml: init
This commit is contained in:
parent
1739ad88f4
commit
b1c99b14ae
39
.github/workflows/readme-generate.yaml
vendored
Normal file
39
.github/workflows/readme-generate.yaml
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
name: Generate README.md
|
||||
run-name: Generate README.md
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
generate-readme:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Generate README.md
|
||||
run: |
|
||||
README_FILE="README.md"
|
||||
releases=$(curl -s "https://api.github.com/repos/minoplhy/deployment/releases")
|
||||
|
||||
echo "# Nginx Releases" > $README_FILE
|
||||
echo "" >> $README_FILE
|
||||
echo "| RELEASE TAG | URL |" >> $README_FILE
|
||||
echo "|--------------|-----------------|" >> $README_FILE
|
||||
|
||||
echo "$releases" | jq -r '.[] | "| \(.name) | [Link](\(.html_url)) |"' >> $README_FILE
|
||||
|
||||
- name: Set Commit Timestamp
|
||||
run: |
|
||||
TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M:%S UTC")
|
||||
echo "TIMESTAMP=${TIMESTAMP}" >> $GITHUB_ENV
|
||||
|
||||
- name: Commit and push README changes
|
||||
if: success()
|
||||
uses: EndBug/add-and-commit@v9
|
||||
with:
|
||||
add: 'README.md'
|
||||
message: '[Actions] Generate Readme.md ${{ env.TIMESTAMP }}'
|
||||
author_name: 'GitHub Actions'
|
||||
author_email: 'hubr@3qx.nl'
|
Loading…
x
Reference in New Issue
Block a user