-
Notifications
You must be signed in to change notification settings - Fork 709
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub action to check for changes to subtrees
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 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,46 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
|
||
# This script will print GitHub errors when files from subtrees have been edited. | ||
# Those files should be edited in their respective repositories. | ||
|
||
MASTER_REVISION=$(git rev-list --first-parent origin/master | head -n 1) | ||
DIFFED_FILES=$(git diff --name-only "$MASTER_REVISION") | ||
|
||
FAILED=false | ||
|
||
if echo "$DIFFED_FILES" | grep -qP "^gamemode/modules/fpp/pp/"; then | ||
echo "::error::Files from Falco's Prop Protection have been edited. Please submit a PR to https://github.com/fptje/falcos-Prop-protection instead!" | ||
FAILED=true | ||
fi | ||
|
||
if echo "$DIFFED_FILES" | grep -qP "^gamemode/libraries/fn.lua"; then | ||
echo "::error::The fn library has been edited. Please submit a PR to https://github.com/fptje/GModFunctional instead!" | ||
FAILED=true | ||
fi | ||
|
||
if echo "$DIFFED_FILES" | grep -qP "^gamemode/libraries/mysqlite/mysqlite.lua"; then | ||
echo "::error::The MySQLite library has been edited. Please submit a PR to https://github.com/fptje/MySQLite instead!" | ||
FAILED=true | ||
fi | ||
|
||
if echo "$DIFFED_FILES" | grep -qP "^gamemode/libraries/simplerr.lua"; then | ||
echo "::error::The Simplerr library has been edited. Please submit a PR to https://github.com/fptje/simplerr instead!" | ||
FAILED=true | ||
fi | ||
|
||
if echo "$DIFFED_FILES" | grep -qP "^gamemode/libraries/sh_cami.lua"; then | ||
echo "::error::The CAMI library has been edited. Please submit a PR to https://github.com/glua/CAMI instead!" | ||
FAILED=true | ||
fi | ||
|
||
if echo "$DIFFED_FILES" | grep -qP "^gamemode/modules/fspectate/"; then | ||
echo "::error::Files from FSpectate have been edited. Please submit a PR to https://github.com/fptje/FSpectate instead!" | ||
FAILED=true | ||
fi | ||
|
||
if [[ "$FAILED" = true ]]; then | ||
exit 1 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: check-modified-subtree | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
check-modified-subtree: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
# Make sure there is access to the master branch | ||
fetch-depth: 0 | ||
clean: false | ||
- run: ./.github/scripts/check-modified-subtree.sh |
db0baba
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pokrenite
db0baba
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will you stop adding random comments to commits? @Barti171