Skip to content

Commit

Permalink
Merge pull request #44 from amplitude/AMP-98487-github-action-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhao900914 authored Apr 30, 2024
2 parents de9600b + 7d81e0a commit 1a1cef3
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/update-metadata.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
name: Update Metadata

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

jobs:
update-metadata:
Expand All @@ -18,11 +14,11 @@ jobs:
- name: Update metadata.yaml
run: |
SHA=$(git rev-parse HEAD)
MESSAGE=$(git log -1 --pretty=%B)
MESSAGE=$(git log --skip=1 --max-count=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
sed -i "s|versions:|versions:\n$NEW_VERSION|" metadata.yaml
- name: Commit and push if changed
run: |
Expand Down

0 comments on commit 1a1cef3

Please sign in to comment.