-
Notifications
You must be signed in to change notification settings - Fork 315
83 lines (68 loc) · 2.27 KB
/
update-moodle-metadata.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: "Scheduled - Update Metadata from Moodle"
on:
# Run on cron, every Sunday at 5:30am UTC.
schedule:
- cron: '30 5 * * 0'
# Run on request.
workflow_dispatch:
inputs:
debug:
type: boolean
required: false
description: 'Set the debug mode'
jobs:
run:
# Only run on the canonical repository.
if: github.repository == 'moodle/devdocs'
name: Fetch the list of components from Moodle
runs-on: ubuntu-latest
steps:
- name: Checkout DevDocs repo
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.x
cache: yarn
- name: Install dependencies
run: yarn install --immutable
- name: Checkout Moodle
uses: actions/checkout@v4
with:
repository: moodle/moodle.git
ref: main
path: .moodle
# The full history is required to generated the list of contributors.
fetch-depth: 0
- name: Ignore Moodle
run: |
echo '.moodle >> .git/info/exclude'
# Note: This will turn into something nicer once we store more metadata about versions and support multiple
# Moodle versions.
- name: Copy component data
run: |
cp .moodle/lib/components.json data/main/
- name: Update component data spelling list
run: |
yarn component-spellings
- name: Copy contributor list
# Get a list of all contributors to Moodle.
# Filter out any containing weird characters, and whose length is three characters or less.
working-directory: .moodle
run: |
../scripts/generate-contributor-list.sh > ../data/moodle-contributors.txt
- name: Fetch third-party libraries list
run: |
yarn libraries-fetch
- name: Generate third-party libraries credits
run: |
yarn libraries-generate
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
add-paths: |
data/*
general/community/credits/thirdpartylibs.md
commit-message: "[repo] Update Moodle Component metadata"
title: "[repo] Update Moodle Component metadata"
signoff: false
delete-branch: true