From bb2f7bfae59f0f34b7df0311c53bf085f62fab72 Mon Sep 17 00:00:00 2001 From: David Zager Date: Thu, 18 Jan 2024 10:23:19 -0500 Subject: [PATCH] :seedling: run pr title check on PR meta changes This also brings the ansible-lint into the PR checks. Signed-off-by: David Zager --- .github/workflows/ansible-lint.yml | 24 ------------- .github/workflows/pr-checks.yml | 31 ---------------- .github/workflows/pr-ci.yml | 53 ++++++++++++++++++++++++++++ .github/workflows/pr-title-check.yml | 13 +++++++ 4 files changed, 66 insertions(+), 55 deletions(-) delete mode 100644 .github/workflows/ansible-lint.yml delete mode 100644 .github/workflows/pr-checks.yml create mode 100644 .github/workflows/pr-ci.yml create mode 100644 .github/workflows/pr-title-check.yml diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml deleted file mode 100644 index a437fb1a..00000000 --- a/.github/workflows/ansible-lint.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Ansible Lint - -on: - pull_request: - branches: - - main - - 'v-*.*.*' - paths: - - 'roles/**' - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout PR branch - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - name: Ansible Lint - uses: ansible/ansible-lint-action@main - with: - path: "roles/" diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml deleted file mode 100644 index eb136229..00000000 --- a/.github/workflows/pr-checks.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: PR Checks - -on: - pull_request: - branches: - - main - - 'release-*.*' - - -jobs: - check-title: - runs-on: ubuntu-latest - steps: - - uses: konveyor/release-tools/cmd/verify-pr@main - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - - build-operator: - needs: check-title - runs-on: ubuntu-latest - env: - IMG: ttl.sh/konveyor-operator-${{ github.sha }}:1h - steps: - - uses: actions/checkout@v3 - - run: make docker-build docker-push - - run-ci: - needs: build-operator - uses: konveyor/ci/.github/workflows/global-ci-bundle.yml@main - with: - operator: ttl.sh/konveyor-operator-${{ github.sha }}:1h diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml new file mode 100644 index 00000000..a13c1d43 --- /dev/null +++ b/.github/workflows/pr-ci.yml @@ -0,0 +1,53 @@ +name: Pull Request CI + +on: + pull_request: + branches: + - main + - 'release-*.*' + +jobs: + detect-changes: + runs-on: ubuntu-latest + # Required permissions + permissions: + pull-requests: read + # Set job outputs to values from filter step + outputs: + roles: ${{ steps.filter.outputs.roles }} + steps: + # For pull requests it's not necessary to checkout the code + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + roles: + - 'roles/**' + + ansible-lint: + needs: detect-changes + if: ${{ needs.detect-changes.outputs.roles == 'true' }} + runs-on: ubuntu-latest + steps: + - name: Checkout PR branch + uses: actions/checkout@v2 + + - name: Ansible Lint + uses: ansible/ansible-lint-action@main + with: + path: "roles/" + + build-operator: + needs: detect-changes + runs-on: ubuntu-latest + env: + IMG: ttl.sh/konveyor-operator-${{ github.sha }}:1h + steps: + - uses: actions/checkout@v3 + - run: make docker-build docker-push + + run-ci: + needs: build-operator + uses: konveyor/ci/.github/workflows/global-ci-bundle.yml@main + with: + operator: ttl.sh/konveyor-operator-${{ github.sha }}:1h diff --git a/.github/workflows/pr-title-check.yml b/.github/workflows/pr-title-check.yml new file mode 100644 index 00000000..bbb09d4e --- /dev/null +++ b/.github/workflows/pr-title-check.yml @@ -0,0 +1,13 @@ +name: PR Title Check + +on: + pull_request_target: + types: [opened, edited, reopened, synchronize] + +jobs: + verify-pr: + runs-on: ubuntu-latest + steps: + - uses: konveyor/release-tools/cmd/verify-pr@main + with: + github_token: ${{ secrets.GITHUB_TOKEN }}