diff --git a/.github/workflows/github_actions.yml b/.github/workflows/github_actions.yml index daaf0e8d71..359971a8f2 100644 --- a/.github/workflows/github_actions.yml +++ b/.github/workflows/github_actions.yml @@ -6,9 +6,29 @@ on: tags-ignore: - "**" jobs: + check-repo: + name: Check for correct repo + runs-on: ubuntu-latest + steps: + - name: Get repository name + run: | + REPO_NAME="${{ github.repository }}" + echo "REPO NAME: $REPO_NAME" + curl -o version.txt https://raw.githubusercontent.com/bywatersolutions/bywater-koha-versions/main/$REPO_NAME + CORRECT_KOHA_VERSION=$(cat version.txt) + echo "CORRECT KOHA VERSION: $CORRECT_KOHA_VERSION" + if [[ "$REPO_NAME" == *"$CORRECT_KOHA_VERSION"* ]]; then + echo "Koha version pushed matches the current Koha version for repo $REPO_NAME" + exit 0 + else + echo "Koha version pushed *does not match* the current Koha version for repo $REPO_NAME" + exit 1 + fi + is-a-mark: if: "contains(github.event.head_commit.message, ' - Set bwsbranch to')" name: Check for mark + needs: [check-repo] runs-on: ubuntu-latest steps: - name: Print commit message @@ -17,6 +37,7 @@ jobs: has-ncip-version: name: Has a matching NCIP server version + needs: [check-repo] runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 @@ -40,6 +61,7 @@ jobs: unit-test: if: github.repository == 'bywatersolutions/bywater-koha' || github.repository == 'bywatersolutions/bywater-koha-future' || github.repository == 'bywatersolutions/bywater-koha-security' name: Run unit tests + needs: [check-repo] runs-on: ubuntu-latest steps: - uses: actions/checkout@v1