forked from Galithil/scilifelab_epps
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #302 from kedhammar/ci
Add GitHub action to check versionlog has been updated for a PR
- Loading branch information
Showing
4 changed files
with
32 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Check VERSIONLOG.MD has been updated | ||
on: [pull_request] | ||
|
||
jobs: | ||
check-versionlog: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout PR | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Fetch all history for all branches and tags | ||
|
||
- name: Check for VERSIONLOG.MD changes | ||
id: versionlog_check | ||
# 1) Find the common ancestor between the current HEAD and the base branch | ||
# 2) Then see if the versionlog has been updated in the PR since it diverged | ||
# from the common ancestor | ||
run: | | ||
PR_BASE_SHA=$(git merge-base HEAD ${{ github.event.pull_request.base.sha }}) | ||
FILE_CHANGED=$(git diff --name-only $PR_BASE_SHA HEAD | grep 'VERSIONLOG.md' || true) | ||
if [ -n "$FILE_CHANGED" ]; then | ||
echo "VERSIONLOG.MD has been changed." | ||
else | ||
echo "VERSIONLOG.MD has NOT been changed." | ||
exit 1 # Fail the workflow if no changes in VERSIONLOG.MD | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ build/ | |
.*_cache/ | ||
*.swp | ||
__pycache__ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters