-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (53 loc) · 1.73 KB
/
update-readme.yml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Update README
on:
workflow_call:
inputs:
target-branch:
description: 'The branch to commit the README.md updates to.'
required: true
type: string
permissions:
contents: write
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout Caller Repository
uses: actions/checkout@v3
with:
ref: ${{ inputs.target-branch }}
fetch-depth: 0
- name: Checkout Reusable Workflow Repository
uses: actions/checkout@v3
with:
repository: PepperDash/readme-automation
path: readme-automation
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
# pip install -r requirements.txt
- name: Run README Update Script
run: |
python readme-automation/.github/scripts/metadata.py
- name: Check for Changes
id: check_for_changes
run: |
if git diff --quiet; then
echo "no_changes=true" >> $GITHUB_OUTPUT
else
echo "no_changes=false" >> $GITHUB_OUTPUT
fi
- name: Create or Switch to 'robot-docs' Branch
run: |
git checkout -B robot-docs
- name: Commit and Push Changes to 'robot-docs' Branch
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add README.md
git commit -m "Automated README update" || echo "No changes to commit"
git push origin robot-docs --force