-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.63 KB
/
update-repos.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
57
58
59
60
name: Update Repositories List
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
update-files:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyyaml requests
- name: Run set_org_custom_properties script
env:
OAUTH_TOKEN: ${{ secrets.OAUTH_TOKEN }}
run: python custom-properties/set_org_custom_properties.py
- name: Run update-repo-list script
run: python scripts/update-repo-list.py
- name: Run update-readme script
run: python scripts/update-readme.py
- name: Install jq
run: sudo apt-get install jq -y
- name: List Repositories
run: |
echo "Listing Repositories"
for repo in $(jq -r '.[]' < ./production-repos.json); do
echo "Listing repository: $repo"
curl -H "Authorization: token ${{ secrets.OAUTH_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/hmcts/$repo
done
shell: bash
continue-on-error: true
- name: Commit and push changes
run: |
git config --global user.name 'hmcts-platform-operations'
git config --global user.email 'github-platform-operations@HMCTS.NET'
git add production-repos.json ReadMe.md
git commit -m 'Update repository list and readme'
git push
env:
GITHUB_TOKEN: ${{ secrets.OAUTH_TOKEN }}