Skip to content

Commit

Permalink
Merge pull request #7 from qld-gov-au/development
Browse files Browse the repository at this point in the history
Update build pipeline so it does not trigger on empty head of branch
  • Loading branch information
duttonw authored May 28, 2024
2 parents 1d7d344 + e0c2130 commit 4accffa
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .github/releases.yml → .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
changelog:
categories:
- title: Breaking Changes 🛠
labels:
- Semver-Major
- breaking-change
- Major---Name-Change
- "Major - Name Change"
labels:
- Semver-Major
- breaking-change
- Major---Name-Change
- "Major - Name Change"
- title: 🏕 Features
labels:
- '*'
Expand Down
30 changes: 24 additions & 6 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,40 @@ jobs:

- run: npm ci

- name: Update
- name: Update & Push git tags
if: ${{ env.HAVE_GIT_DEPLOY_KEY == 'true' }}
run: |
force="${{ github.event.inputs.force }}"
dry="${{ github.event.inputs.dry }}"
bump="${{ github.event.inputs.bump }}"
if [ "$bump" = "" ]; then
bump="patch"
fi
# Fetch the latest tags
git fetch --tags
# Get the latest tag
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
# Get the current commit hash
CURRENT_COMMIT=$(git rev-parse HEAD)
# Check if there are changes between the latest tag and the current commit
if git diff --quiet $LATEST_TAG $CURRENT_COMMIT; then
if [ "$force" != "1" ]; then
echo "No changes detected between the latest tag ($LATEST_TAG) and the current commit ($CURRENT_COMMIT)." >> $GITHUB_STEP_SUMMARY
exit 0
else
echo "Force flag set continuing: No changes detected between the latest tag ($LATEST_TAG) and the current commit ($CURRENT_COMMIT)." >> $GITHUB_STEP_SUMMARY
fi
else
echo "Changes detected between the latest tag ($LATEST_TAG) and the current commit ($CURRENT_COMMIT)." >> $GITHUB_STEP_SUMMARY
fi
# Bump Version
npm version "$bump"

- name: Push git tags
if: ${{ env.HAVE_GIT_DEPLOY_KEY == 'true' }}
run: |
dry="${{ github.event.inputs.dry }}"
# Push
if [ "$dry" = "1" ]; then
Expand Down

0 comments on commit 4accffa

Please sign in to comment.