Bump peter-evans/create-pull-request from 7 to 8 (#4029) #12723
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 | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| - 'release-*' | |
| tags: | |
| - 'v*.*.*' | |
| pull_request: | |
| branches: | |
| - 'main' | |
| - 'release-*' | |
| schedule: | |
| - cron: "0 6 * * *" # Daily at 06:00. | |
| workflow_dispatch: # Manual workflow trigger | |
| inputs: | |
| skip-override-snapshot-gen: | |
| type: boolean | |
| default: false | |
| required: false | |
| description: "Skip override-snapshot creation" | |
| jobs: | |
| generated-files-committed: | |
| name: Generated files are committed | |
| runs-on: ubuntu-latest | |
| env: | |
| GOPATH: ${{ github.workspace }} | |
| steps: | |
| - name: Setup Golang | |
| uses: openshift-knative/hack/actions/setup-go@main | |
| - name: Install CLI tools from OpenShift Mirror | |
| uses: redhat-actions/openshift-tools-installer@v1 | |
| with: | |
| # Installs the latest release of oc with the major version 4. | |
| oc: "4" | |
| - name: Install yq | |
| run: | | |
| go install github.com/mikefarah/yq/v3@latest | |
| - name: Install OPM | |
| run: | | |
| go install github.com/operator-framework/operator-registry/cmd/opm@v1.47.0 | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| path: ./src/github.com/${{ github.repository }} | |
| fetch-depth: 0 | |
| - name: Merge upstream | |
| if: github.event_name == 'pull_request' | |
| working-directory: ./src/github.com/${{ github.repository }} | |
| run: | | |
| if ! git config user.name > /dev/null; then | |
| git config user.name "John Doe" | |
| fi | |
| if ! git config user.email > /dev/null; then | |
| git config user.email "johndoe@localhost" | |
| fi | |
| git remote add upstream https://github.com/${{ github.repository }}.git | |
| git pull --no-rebase upstream ${{ github.base_ref }} | |
| shell: bash | |
| - name: Set CURRENT_VERSION_IMAGES | |
| working-directory: ./src/github.com/${{ github.repository }} | |
| if: (github.event_name == 'pull_request' && github.base_ref != 'main') || ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref_name != 'main') | |
| run: | | |
| tag="release-$(yq read ./olm-catalog/serverless-operator/project.yaml 'project.version')" | |
| echo "CURRENT_VERSION_IMAGES=${tag}" >> $GITHUB_ENV | |
| shell: bash | |
| - name: Regenerate all generated files | |
| working-directory: ./src/github.com/${{ github.repository }} | |
| run: make generated-files | |
| # FBC catalog generation was moved to Konflux driven pipeline | |
| - name: Regenerate override-snapshot | |
| if: ( github.event_name == 'workflow_dispatch' && github.event.inputs.skip-override-snapshot-gen == 'false' ) || github.event_name == 'schedule' || ( github.event_name == 'push' && !contains(github.ref_name, 'dependabot/') ) | |
| working-directory: ./src/github.com/${{ github.repository }} | |
| run: make generate-override-snapshot | |
| # Optional: | |
| # Since we're generating files based on a floating branch in midstream, | |
| # we need to reconcile those files periodically. | |
| # | |
| # when it's manually triggered or a scheduled run. | |
| - name: Create Pull Request | |
| if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || ( github.event_name == 'push' && !contains(github.ref_name, 'dependabot/') ) | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| token: ${{ secrets.SERVERLESS_QE_ROBOT }} | |
| path: ./src/github.com/${{ github.repository }} | |
| branch: auto/update-generated-files-${{ github.ref_name }} | |
| title: "[${{ github.ref_name }}] Run make generated-files" | |
| commit-message: "Run make generated-files" | |
| delete-branch: true | |
| body: | | |
| Generated by running `make generated-files` | |
| - name: Check if everything is consistent | |
| working-directory: ./src/github.com/${{ github.repository }} | |
| run: ./hack/verify-diff.sh | |
| - name: Check existence of skipRange and replaces in ClusterServiceVersion | |
| working-directory: ./src/github.com/${{ github.repository }} | |
| run: | | |
| csv="olm-catalog/serverless-operator/manifests/serverless-operator.clusterserviceversion.yaml" | |
| if [[ "$(GOFLAGS='' go run github.com/mikefarah/yq/v3@latest read "$csv" spec.replaces)" == "" || \ | |
| "$(GOFLAGS='' go run github.com/mikefarah/yq/v3@latest read "$csv" 'metadata.annotations."olm.skipRange"')" == "" ]]; then | |
| echo '::error:: Missing spec.replaces or metadata.annotations."olm.skipRange" in CSV.' | |
| exit 34 | |
| fi | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| env: | |
| GOPATH: ${{ github.workspace }} | |
| steps: | |
| - name: Setup Golang | |
| uses: openshift-knative/hack/actions/setup-go@main | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| path: ./src/github.com/${{ github.repository }} | |
| - name: Install Tools | |
| working-directory: ./src/github.com/${{ github.repository }} | |
| env: | |
| WOKE_VERSION: v0.13.0 | |
| OSDK_VERSION: v1.12.0 | |
| run: | | |
| TEMP_PATH="$(mktemp -d)" | |
| cd $TEMP_PATH | |
| echo '::group::🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog' | |
| curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b "${TEMP_PATH}" 2>&1 | |
| echo '::endgroup::' | |
| echo '::group:: Installing misspell ... https://github.com/client9/misspell' | |
| go install github.com/client9/misspell/cmd/misspell@latest | |
| echo '::endgroup::' | |
| echo '::group:: Installing woke ... https://github.com/get-woke/woke' | |
| curl -sfL https://raw.githubusercontent.com/get-woke/woke/main/install.sh | sh -s -- -b "${TEMP_PATH}" "${WOKE_VERSION}" 2>&1 | |
| echo '::endgroup::' | |
| echo '::group:: Installing operator-sdk ... https://github.com/operator-framework/operator-sdk/' | |
| curl -sfL https://github.com/operator-framework/operator-sdk/releases/download/${OSDK_VERSION}/operator-sdk_linux_amd64 -o "${TEMP_PATH}/operator-sdk" | |
| chmod +x "${TEMP_PATH}/operator-sdk" | |
| echo "${TEMP_PATH}" >> $GITHUB_PATH | |
| - name: Shellcheck | |
| working-directory: ./src/github.com/${{ github.repository }} | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} | |
| run: | | |
| find . -type f \ | |
| -path './**/*.*sh' \ | |
| -not -path '*vendor*' | xargs -r shellcheck --format=checkstyle \ | |
| | reviewdog -f=checkstyle \ | |
| -name="shellcheck" \ | |
| -reporter="github-pr-check" \ | |
| -filter-mode="added" \ | |
| -fail-on-error="true" \ | |
| -level="error" | |
| - name: Go Lint - knative-operator | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: v2.9 | |
| args: --timeout=10m0s --verbose | |
| working-directory: ./src/github.com/${{ github.repository }} | |
| # This is mostly copied from https://github.com/get-woke/woke-action-reviewdog/blob/main/entrypoint.sh | |
| # since their action is not yet released under a stable version. | |
| - name: Language | |
| if: ${{ always() && github.event_name == 'pull_request' }} | |
| working-directory: ./src/github.com/${{ github.repository }} | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} | |
| run: | | |
| woke --output simple \ | |
| | reviewdog -efm="%f:%l:%c: %m" \ | |
| -name="woke" \ | |
| -reporter="github-pr-check" \ | |
| -filter-mode="added" \ | |
| -fail-on-error="true" \ | |
| -level="error" | |
| - name: OLM Bundle | |
| working-directory: ./src/github.com/${{ github.repository }} | |
| run: | | |
| operator-sdk bundle validate ./olm-catalog/serverless-operator --select-optional suite=operatorframework --optional-values=k8s-version=1.22 | |
| - name: Spelling | |
| working-directory: ./src/github.com/${{ github.repository }} | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} | |
| run: | | |
| # Don't fail because of misspell | |
| set +o pipefail | |
| git ls-files | grep -Ev '^(vendor/|.git)' | xargs misspell -i importas -error \ | |
| | reviewdog -efm="%f:%l:%c: %m" \ | |
| -name="github.com/client9/misspell" \ | |
| -reporter="github-pr-check" \ | |
| -filter-mode="added" \ | |
| -fail-on-error="true" \ | |
| -level="error" | |
| - name: Prettify code | |
| uses: creyD/prettier_action@v4.6 | |
| with: | |
| dry: true | |
| prettier_options: --check src/github.com/${{ github.repository }}/templates/*.yaml |