-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (42 loc) · 1.32 KB
/
Copy pathlambda-readme.yml
File metadata and controls
50 lines (42 loc) · 1.32 KB
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
name: Lambda README Generation
on:
pull_request:
paths:
- 'apps/backend/lambdas/**'
- '!apps/backend/lambdas/**/README.md'
push:
branches: [main, develop]
paths:
- 'apps/backend/lambdas/**'
- '!apps/backend/lambdas/**/README.md'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
generate-readmes:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref_name }}
token: ${{ secrets.GH_PAT }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Generate READMEs
working-directory: apps/backend/lambdas
run: node tools/lambda-cli.js generate-readme
- name: Commit updated READMEs
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add apps/backend/lambdas/*/README.md
if git diff --staged --quiet; then
echo "No README changes to commit"
else
git commit -m "chore: regenerate lambda READMEs"
git push
fi