Skip to content

[INFRA-190] Adding PR checks #1

[INFRA-190] Adding PR checks

[INFRA-190] Adding PR checks #1

Workflow file for this run

name: PR Checks
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
run_checks:
permissions:
contents: read
packages: read
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Check if chart version is updated
id: check-version
uses: oras-project/setup-oras@v1
- run: |
CHART_VERSION=$(grep '^version:' Chart.yaml | awk '{print $2}')
oras repo tags ghcr.io/kobotoolbox/kobo | grep -qvz "${CHART_VERSION}"
- name: Set up Helm
uses: alexellis/arkade-get@master
with:
helm: latest
- name: Verify helm chart is valid
run: |
helm lint --strict --set kpi.env.secret.DATABASE_URL=test --set kobotoolbox.kobocatDatabase=test --set kpi.version=test
- name: Fail if chart version is not updated
if: failure() && steps.check-version.outcome == failure()
run: |
echo "The chart version ${CHART_VERSION} is already in the repository. You likely want to update the version in Chart.yaml before merging."