Skip to content

Commit

Permalink
Fix action.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dpanta94 committed Oct 18, 2024
1 parent d784988 commit 327f984
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/actions/process-changelog/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ runs:
echo "CURRENT_VERSION=$CURRENT_RELEASE_VERSION" >> $GITHUB_OUTPUT
fi
- name: "Process changelog for changelog.txt"
- name: "Process changelog for changelog.md"
id: process_changelog
shell: bash
env:
Expand All @@ -51,7 +51,7 @@ runs:
RELEASE_DATE: ${{ inputs.release-date }}
run: |
if ${{ env.ACTION_TYPE == 'amend-version' }}; then
sed -i "s/^= $CURRENT_VERSION - .* =$/= $RELEASE_VERSION - $RELEASE_DATE =/" changelog.txt
sed -i "s/^= $CURRENT_VERSION - .* =$/= $RELEASE_VERSION - $RELEASE_DATE =/" changelog.md
else
# Install this dev package globally to gather changelog entries while not including it into the release package
composer global require automattic/jetpack-changelogger:^3.0.7
Expand All @@ -67,7 +67,7 @@ runs:
~/.composer/vendor/bin/changelogger write --use-version="$RELEASE_VERSION" --release-date="$RELEASE_DATE" $CHANGELOG_FLAG --no-interaction --yes
fi
CHANGELOG=$(awk '/^= / { if (p) { exit }; p=1; next } p && NF' changelog.txt)
CHANGELOG=$(awk '/^= / { if (p) { exit }; p=1; next } p && NF' changelog.md)
# Escape backslash, new line and ampersand characters. The order is important.
CHANGELOG=${CHANGELOG//\\/\\\\}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/process-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ jobs:
regex=$(echo "$version" | jq -r '.regex')
existing_version=$(grep -Po "$regex" "$file" | grep -Po '(\d+\.\d+\.\d+(\.\d+)?)')
echo "Current version: $existing_version"
if [ -n "$existing_version" ]; then
echo "Release version: $existing_version"
Expand All @@ -90,6 +89,7 @@ jobs:
id: format_date
run: |
RELEASE_DATE=$( date "+%Y-%m-%d" -d "$RELEASE_DATE" ) # Release date formatted as YYYY-MM-DD
echo "Release date: $RELEASE_DATE"
echo "RELEASE_DATE=$RELEASE_DATE" >> $GITHUB_OUTPUT
- name: Create new branch
Expand Down

0 comments on commit 327f984

Please sign in to comment.