Skip to content

Commit adbf8b4

Browse files
committed
ci: fix release workflow to not fail if no Lambda annotations changes
1 parent d51554c commit adbf8b4

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/workflows/create-release-pr.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,12 @@ jobs:
7575
run: |
7676
dotnet build Libraries/Libraries.sln -c Release
7777
git add "*.template"
78-
git commit -m "Update test app CloudFormation templates"
78+
79+
if git diff --cached --quiet; then
80+
echo "No .template files were staged; skipping commit."
81+
else
82+
git commit -m "Update test app CloudFormation templates"
83+
fi
7984
# Update the changelog based on the change files
8085
- name: Update Changelog
8186
run: autover changelog
@@ -99,9 +104,9 @@ jobs:
99104
echo "CHANGELOG<<EOF"$'\n'"$changelog"$'\n'EOF >> "$GITHUB_OUTPUT"
100105
# Create the Release PR and label it
101106
- name: Create Pull Request
102-
env:
103-
GITHUB_TOKEN: ${{ env.AWS_SECRET_TOKEN }}
104-
run: |
105-
pr_url="$(gh pr create --title "${{ steps.read-release-name.outputs.VERSION }}" --body "${{ steps.read-changelog.outputs.CHANGELOG }}" --base dev --head ${{ steps.create-release-branch.outputs.BRANCH }})"
106-
gh label create "Release PR" --description "A Release PR that includes versioning and changelog changes" -c "#FF0000" -f
107-
gh pr edit $pr_url --add-label "Release PR"
107+
env:
108+
GITHUB_TOKEN: ${{ env.AWS_SECRET_TOKEN }}
109+
run: |
110+
pr_url="$(gh pr create --title "${{ steps.read-release-name.outputs.VERSION }}" --body "${{ steps.read-changelog.outputs.CHANGELOG }}" --base dev --head ${{ steps.create-release-branch.outputs.BRANCH }})"
111+
gh label create "Release PR" --description "A Release PR that includes versioning and changelog changes" -c "#FF0000" -f
112+
gh pr edit $pr_url --add-label "Release PR"

0 commit comments

Comments
 (0)