-
Notifications
You must be signed in to change notification settings - Fork 5
56 lines (50 loc) · 1.88 KB
/
generate_content.yaml
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
name: Update Content
env:
# Current supported mode: 'table' and 'list'
content_mode: "table"
on:
## Trigger on merge event to main brnach
push:
branches: main
paths:
- 'generate_content.sh'
- 'repository_list.txt'
- '.github/workflows/*'
## Manual trigger
workflow_dispatch:
## Optional: Schedule trigger to update the content regularly
# schedule:
# - cron: '0 0 * * 6' # Run every Saturday at midnight
jobs:
update-content:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Generate content
run: |
echo "Repo owner: ${{ github.repository_owner }}"
echo "Content mode: ${{ env.content_mode }}"
./generate_content.sh repository_list.txt ${{ env.content_mode }} ${{ github.repository_owner }}
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
# Goto: Repo > Setting > Action > General > Workflow permission, enable following options:
# Read and write permissions
# Allow GitHub Actions to create and approve pull requests
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Automated update table of content'
committer: 'github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>'
author: '${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>'
signoff: false
branch: update-content
branch-suffix: timestamp
delete-branch: true
base: 'main'
title: '[Automated] Update table of content'
body: |
[Automated] Update table of content
- Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
labels: 'update, automated-pr'