-
Notifications
You must be signed in to change notification settings - Fork 2
33 lines (29 loc) · 1.02 KB
/
update-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
name: Update Metadata
on:
workflow_dispatch:
inputs:
releaseDescription:
required: true
default: $(git log --max-count=1 --pretty=%B)
jobs:
update-metadata:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Qutoes in message are not allowed
- name: Update metadata.yaml
run: |
SHA=$(git rev-parse HEAD)
MESSAGE=${{ github.event.inputs.releaseDescription }}
NEW_VERSION=" - sha: $SHA\n changeNotes: $MESSAGE"
echo "New version info to be added: \n"
echo "$NEW_VERSION"
sed -i "s|versions:|versions:\n$NEW_VERSION|" metadata.yaml
- name: Commit and push if changed
run: |
git config --local user.email [email protected]
git config --local user.name amplitude-sdk-bot
git add metadata.yaml
git commit -m "Update metadata.yaml" || exit 0 # Exit 0 if no changes
git push