Change PR checks
This commit is contained in:
parent
c0f95b8929
commit
978e78ee26
|
@ -135,15 +135,31 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }}
|
token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }}
|
||||||
fetch-depth: 0
|
|
||||||
- name: Check submodule
|
- name: Fetch develop branch
|
||||||
|
run: git fetch origin develop
|
||||||
|
|
||||||
|
- name: Check pro commit
|
||||||
|
id: pro_commit
|
||||||
run: |
|
run: |
|
||||||
cd packages/pro
|
cd submodule
|
||||||
git fetch
|
pro_commit=$(git rev-parse HEAD)
|
||||||
if ! git merge-base --is-ancestor $(git log -n 1 --pretty=format:%H) origin/develop; then
|
latest_commit=$(git rev-parse origin/develop)
|
||||||
echo "Current commit has not been merged to develop"
|
echo "::set-output name=pro_commit::$pro_commit"
|
||||||
echo "Refer to the pro repo to merge your changes: https://github.com/Budibase/budibase-pro/blob/develop/docs/getting_started.md"
|
echo "::set-output name=latest_commit::$latest_commit"
|
||||||
exit 1
|
|
||||||
else
|
- name: Check submodule merged to develop
|
||||||
echo "All good, the submodule had been merged!"
|
uses: actions/github-script@v4
|
||||||
fi
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
script: |
|
||||||
|
const submoduleCommit = '${{ steps.pro_commit.outputs.pro_commit }}';
|
||||||
|
const latestCommit = '${{ steps.pro_commit.outputs.latest_commit }}';
|
||||||
|
|
||||||
|
if (submoduleCommit !== latestCommit) {
|
||||||
|
console.error('Submodule commit does not match the latest commit on the develop branch.');
|
||||||
|
console.error('Refer to the pro repo to merge your changes: https://github.com/Budibase/budibase-pro/blob/develop/docs/getting_started.md')
|
||||||
|
process.exit(1);
|
||||||
|
} else {
|
||||||
|
console.log('All good, the submodule had been merged and setup correctly!')
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue