chore(main): [bot] release ckan:1.5.0 #8306
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Validate README Changes | |
| on: | |
| pull_request_target: | |
| types: | |
| - opened | |
| - edited | |
| - reopened | |
| - synchronize | |
| merge_group: | |
| types: | |
| - checks_requested | |
| jobs: | |
| getChangedCharts: | |
| uses: ./.github/workflows/get-changed-charts.yaml | |
| permissions: | |
| pull-requests: read | |
| contents: read | |
| with: | |
| pr_number: ${{ github.event.pull_request.number || -1 }} | |
| base_commit: ${{ github.event.merge_group.base_sha || 'missing' }} | |
| head_commit: ${{ github.event.merge_group.head_sha || 'missing' }} | |
| validateREADMEChanges: | |
| name: Validate README changes | |
| runs-on: ubuntu-latest | |
| needs: | |
| - getChangedCharts | |
| permissions: | |
| pull-requests: read | |
| contents: read | |
| strategy: | |
| matrix: | |
| chart: ${{ fromJson(needs.getChangedCharts.outputs.charts) }} | |
| steps: | |
| - run: pip install yq | |
| - name: Conventional commit check | |
| uses: cocogitto/cocogitto-action@390bda87a19bf627e03ad075c67a11e9ddbb7547 # v4 | |
| with: | |
| command: help # I just want to install cog... | |
| - name: Verify readme is updated on major update | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| CHANGED_CHART: ${{ matrix.chart }} | |
| BASE_COMMIT: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }} | |
| HEAD_COMMIT: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} | |
| run: | | |
| [[ "$RUNNER_DEBUG" == 1 ]] && set -x | |
| set -e | |
| set -o pipefail | |
| hasBreakingChange=false | |
| #shellcheck disable=SC2086 | |
| for commit in $(gh api --paginate "/repos/${GITHUB_REPOSITORY}/compare/${BASE_COMMIT}...${HEAD_COMMIT}" | jq -r '.commits | map(.sha)[]'); do | |
| if cog verify "$(gh api --paginate /repos/${GITHUB_REPOSITORY}/commits/$commit | jq -r .commit.message)" 2>&1 | grep -qi 'BREAKING CHANGE'; then | |
| hasBreakingChange=true | |
| break | |
| fi | |
| done | |
| if [[ "$hasBreakingChange" == true ]]; then | |
| major="$(gh api --paginate "/repos/${GITHUB_REPOSITORY}/contents/charts/${CHANGED_CHART}/Chart.yaml?ref=${HEAD_COMMIT}" | jq -er .content | base64 -d | yq -er '.version | split(".")[0]')" | |
| migrationLine="### $major.x.x -> $(( major + 1)).0.0" | |
| if [[ "$(gh api --paginate "/repos/${GITHUB_REPOSITORY}/contents/charts/${CHANGED_CHART}/README.md.gotmpl?ref=${HEAD_COMMIT}" | jq -er .content | base64 -d | grep -Fc "$migrationLine")" != 1 ]]; then | |
| echo "You need to provide a migration info for this breaking change, and exactly one" >&2 | |
| echo "Add > $migrationLine < to README.md.gotmpl" >&2 | |
| exit 1 | |
| fi | |
| fi |