-
Notifications
You must be signed in to change notification settings - Fork 39
68 lines (59 loc) · 1.8 KB
/
updateChangelogs.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
61
62
63
64
65
66
67
68
name: Update Changelogs
on:
push:
branches:
- master
jobs:
update-changelog-files:
runs-on: ubuntu-latest
permissions:
contents: 'write'
packages: 'write'
actions: 'read'
steps:
- name: Authorize Mikroe Actions App
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.MIKROE_ACTIONS }}
private-key: ${{ secrets.MIKROE_ACTIONS_KEY_AUTHORIZE }}
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Cache Python packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install requests
pip install chardet
pip install py7zr
pip install packaging
- name: Update changelogs
run: |
python -u scripts/log_changes.py
- name: Add GitHub Actions credentials
run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: Commit and Push Changes
run: |
if [ -n "$(git status --porcelain changelog*)" ]; then
echo "Updating with new changelog files";
git add changelog*
git commit -m "Updated changelog files with latest merged release."
git push
else
echo "No changes made to changelog files";
fi