Skip to content

Commit

Permalink
Check for changelog latest version
Browse files Browse the repository at this point in the history
should skip the next time
  • Loading branch information
prvashisht committed Jun 10, 2024
1 parent af654e9 commit a3034a2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/release-extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,35 @@ jobs:
sed -E -i.bak 's/Version-[0-9]+\.[0-9]+(\.[0-9]+)?/Version-'${VERSION}'/' README.md
rm README.md.bak
- name: Check CHANGELOG version
id: check_changelog_version
run: |
VERSION=${{ needs.check_version.outputs.new_version }}
THIRD_LINE=$(sed -n '3p' CHANGELOG.md)
if echo "$THIRD_LINE" | grep -q "v$VERSION"; then
echo "CHANGELOG already contains the new version."
echo "skip_update=true" >> $GITHUB_ENV
else
echo "CHANGELOG needs to be updated."
echo "skip_update=false" >> $GITHUB_ENV
fi
exit 1
- name: Update CHANGELOG
if: env.skip_update == 'false'
run: |
VERSION=${{ needs.check_version.outputs.new_version }}
FORMATTED_CHANGELOG=$(echo "$CHANGELOG" | sed 's/\\n/\n/g' | sed 's/^/ - /')
NEW_CHANGELOG=$(echo "- \`v${VERSION}\`\n${FORMATTED_CHANGELOG}\n" | sed 's/\\n/\n/g')
awk -v new_changelog="$NEW_CHANGELOG" 'NR==3{print new_changelog}1' CHANGELOG.md > tmpfile && mv tmpfile CHANGELOG.md
- name: Commit changes
if: env.skip_update == 'false'
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git add README.md CHANGELOG.md
git add .
git diff --staged
git commit -m "Update README and CHANGELOG for v${{ needs.check_version.outputs.new_version }}"
- name: Create Pull Request
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "SignatureSync: Pro Signatures",
"short_name": "SignatureSync",
"description": "Simplify your messaging with SignatureSync, the tool that automates your signatures, ensuring a professional touch every time.",
"version": "4.0",
"version": "3.4",
"icons": {
"16": "icons/light/icon16.png",
"32": "icons/light/icon32.png",
Expand Down

0 comments on commit a3034a2

Please sign in to comment.