Skip to content

Commit

Permalink
check that a commit is not in the develop history before running the … (
Browse files Browse the repository at this point in the history
#26)

* check that a commit is not in the develop history before running the version check #25

* version bump
  • Loading branch information
Scott Wyman Neagle authored Jan 28, 2022
1 parent 43da4f9 commit aa1d137
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
⚠️ Add a note to /CHANGELOG.md with your version number and the date, summarizing the changes.
⚠️ If your pull request fixes an open issue, please link to the issue.
⚠️ Rebase the latest changes from the develop branch. Assuming origin points to https://github.com/AgnostiqHQ/covalent, you should run git rebase origin/develop.
-->

- [ ] I have added the tests to cover my changes.
- [ ] I have updated the documentation, VERSION, and CHANGELOG accordingly.
- [ ] I have read the CONTRIBUTING document.
-->
10 changes: 10 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,18 @@ jobs:
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Check git history
run: |
if git merge-base --is-ancestor $GITHUB_SHA origin/develop; then
echo "DEVELOP_COMMIT_HISTORY=$GITHUB_SHA" >> $GITHUB_ENV
fi
- name: Read head version
if: ${{ github.sha != env.DEVELOP_COMMIT_HISTORY }}
run: |
HEAD_VERSION="$(cat ./VERSION)"
echo "HEAD_VERSION=$HEAD_VERSION" >> $GITHUB_ENV
- name: Validate changelog entry
if: ${{ github.sha != env.DEVELOP_COMMIT_HISTORY }}
run: |
git diff --name-only origin/develop | grep CHANGELOG
if [[ $(grep -c "\b${HEAD_VERSION}\b" CHANGELOG.md) > 1 ]]; then
Expand All @@ -58,12 +65,15 @@ jobs:
exit 3
fi
- name: Check out base
if: ${{ github.sha != env.DEVELOP_COMMIT_HISTORY }}
run: git checkout develop
- name: Read base version
if: ${{ github.sha != env.DEVELOP_COMMIT_HISTORY }}
run: |
BASE_VERSION="$(cat ./VERSION)"
echo "BASE_VERSION=$BASE_VERSION" >> $GITHUB_ENV
- name: Validate version change
if: ${{ github.sha != env.DEVELOP_COMMIT_HISTORY }}
run: |
echo "head version is ${HEAD_VERSION}"
echo "base version is ${BASE_VERSION}"
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.22.9] - 2022-01-27

### Fixed

- Fixing version check action so that it doesn't run on commits that are in develop
- Edited PR template so that markdown checklist appears properly

## [0.22.8] - 2022-01-27

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.22.8
0.22.9

0 comments on commit aa1d137

Please sign in to comment.