Skip to content

Commit

Permalink
Add update-metadata.yml (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mercy811 authored Mar 22, 2024
1 parent a3bd3d1 commit 99966c9
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/update-metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Update Metadata

on:
push:
branches:
- main
paths:
- template.tpl # The workflow should only trigger on changes to template.tpl

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=$(git log -1 --pretty=%B)
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

0 comments on commit 99966c9

Please sign in to comment.