This commit is contained in:
Adria Navarro 2023-06-20 12:54:25 +01:00
parent 68d9dcbeac
commit b6e3d26ef2
1 changed files with 37 additions and 0 deletions

View File

@ -130,3 +130,40 @@ jobs:
env: env:
BB_ADMIN_USER_EMAIL: admin BB_ADMIN_USER_EMAIL: admin
BB_ADMIN_USER_PASSWORD: admin BB_ADMIN_USER_PASSWORD: admin
check-pro-submodule:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true
token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }}
- name: Fetch develop branch
run: git fetch origin develop
- name: Check pro commit
id: get_pro_commits
run: |
cd submodule
pro_commit=$(git rev-parse HEAD)
latest_commit=$(git rev-parse origin/develop)
echo "pro_commit=$pro_commit" >> "$GITHUB_OUTPUT"
echo "latest_commit=$latest_commit" >> "$GITHUB_OUTPUT"
- name: Check submodule merged to develop
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const submoduleCommit = '${{ steps.get_pro_commits.outputs.pro_commit }}';
const latestCommit = '${{ steps.get_pro_commits.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!')
}