This commit is contained in:
Adria Navarro 2023-06-20 14:07:52 +01:00
parent 88f8849a41
commit e9398e3a0b
1 changed files with 8 additions and 12 deletions

View File

@ -146,23 +146,19 @@ jobs:
cd packages/pro cd packages/pro
pro_commit=$(git rev-parse HEAD) pro_commit=$(git rev-parse HEAD)
branch=${{ github.base_ref || github.head_ref || github.ref_name }} branch=${{ github.base_ref || github.ref_name }}
echo "branch=$branch" echo "Running on branch `$branch` (base_ref=${{ github.base_ref }}, ref_name=${{ github.head_ref }})"
echo "base_ref=${{ github.base_ref }}"
echo "head_ref=${{ github.head_ref }}"
echo "ref_name=${{ github.head_ref }}""
echo "Running on branch ${{ github.ref }}
if [[ "$branch" == "master" ]]; then if [[ "$branch" == "master" ]]; then
latest_commit=$(git rev-parse origin/master) base_commit=$(git rev-parse origin/master)
else else
latest_commit=$(git rev-parse origin/develop) base_commit=$(git rev-parse origin/develop)
fi fi
echo "pro_commit=$pro_commit" echo "pro_commit=$pro_commit"
echo "pro_commit=$pro_commit" >> "$GITHUB_OUTPUT" echo "pro_commit=$pro_commit" >> "$GITHUB_OUTPUT"
echo "latest_commit=$latest_commit" echo "base_commit=$base_commit"
echo "latest_commit=$latest_commit" >> "$GITHUB_OUTPUT" echo "base_commit=$base_commit" >> "$GITHUB_OUTPUT"
- name: Check submodule merged to develop - name: Check submodule merged to develop
uses: actions/github-script@v4 uses: actions/github-script@v4
@ -170,9 +166,9 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
script: | script: |
const submoduleCommit = '${{ steps.get_pro_commits.outputs.pro_commit }}'; const submoduleCommit = '${{ steps.get_pro_commits.outputs.pro_commit }}';
const latestCommit = '${{ steps.get_pro_commits.outputs.latest_commit }}'; const baseCommit = '${{ steps.get_pro_commits.outputs.base_commit }}';
if (submoduleCommit !== latestCommit) { if (submoduleCommit !== baseCommit) {
console.error('Submodule commit does not match the latest commit on the develop branch.'); 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') 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); process.exit(1);