"Fix" pipeline

This commit is contained in:
Adria Navarro 2023-06-20 12:51:57 +01:00
parent a4ce3f5e35
commit 99223d25ce
1 changed files with 26 additions and 22 deletions

View File

@ -1,5 +1,9 @@
name: Budibase CI name: Budibase CI
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on: on:
# Trigger the workflow on push or pull request, # Trigger the workflow on push or pull request,
# but only for the master branch # but only for the master branch
@ -141,27 +145,27 @@ jobs:
with: with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }}
- name: Check pro commit # - name: Check pro commit
id: get_pro_commits # id: get_pro_commits
run: | # run: |
cd submodule # cd submodule
pro_commit=$(git rev-parse HEAD) # pro_commit=$(git rev-parse HEAD)
latest_commit=$(git rev-parse origin/develop) # latest_commit=$(git rev-parse origin/develop)
echo "pro_commit=$pro_commit" >> "$GITHUB_OUTPUT" # echo "pro_commit=$pro_commit" >> "$GITHUB_OUTPUT"
echo "latest_commit=$latest_commit" >> "$GITHUB_OUTPUT" # echo "latest_commit=$latest_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
with: # with:
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 latestCommit = '${{ steps.get_pro_commits.outputs.latest_commit }}';
if (submoduleCommit !== latestCommit) { # if (submoduleCommit !== latestCommit) {
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);
} else { # } else {
console.log('All good, the submodule had been merged and setup correctly!') # console.log('All good, the submodule had been merged and setup correctly!')
} # }