Skip to content

Commit

Permalink
Release only if changes persist
Browse files Browse the repository at this point in the history
  • Loading branch information
squadgazzz committed Jan 31, 2024
1 parent f152d67 commit c577636
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Weekly Release

on:
workflow_dispatch:
pull_request:
schedule:
# At 00:00 on Monday
- cron: "0 0 * * 1"
Expand All @@ -17,7 +18,20 @@ jobs:
# Requires "Read and Write access to code" permission
token: ${{ secrets.RELEASE_ACTION_ACCESS_TOKEN }}

- name: Check for changes since last tag
id: check_changes
run: |
LATEST_TAG=$(git tag --sort=-authordate --merged=main | head --lines 1)
CHANGES=$(git log $LATEST_TAG..HEAD --oneline)
if [[ -z "$CHANGES" ]]; then
echo "No changes since the last tag."
else
echo "Changes detected since the last tag."
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Create Tag
if: ${{ steps.check_changes.outputs.has_changes }}
id: tag_version
run: |
# Extracts the latest version tag, bumps the minor version
Expand Down

0 comments on commit c577636

Please sign in to comment.