diff --git a/.github/workflows/image-cleanup.yml b/.github/workflows/image-cleanup.yml index c5aadb7ff1..b241174208 100644 --- a/.github/workflows/image-cleanup.yml +++ b/.github/workflows/image-cleanup.yml @@ -18,4 +18,4 @@ jobs: ignore-missing-package: true tag-regex: pr-${{ github.event.number }}-.* tagged-keep-latest: 0 - if: github.repository_owner == 'cryostatio' + #if: github.repository_owner == 'cryostatio' diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index dfe6f4b87b..2d5f24509d 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -12,7 +12,9 @@ on: jobs: check-before-build: runs-on: ubuntu-latest - if: github.repository_owner == 'cryostatio' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/build_test') + #if: github.repository_owner == 'cryostatio' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/build_test') + if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/build_test') + steps: - name: Fail if needs-triage label applied if: ${{ contains(github.event.issue.labels.*.name, 'needs-triage') }} diff --git a/.github/workflows/pr-request-review.yml b/.github/workflows/pr-request-review.yml new file mode 100644 index 0000000000..83fc2b8687 --- /dev/null +++ b/.github/workflows/pr-request-review.yml @@ -0,0 +1,56 @@ +name: Request Review + +on: + issue_comment: + types: + - created + +jobs: + request-review: + runs-on: ubuntu-latest + permissions: + pull-requests: write + + if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/request_review') + + steps: + - name: Set up GitHub CLI + uses: actions/setup-gh@v2 + with: + gh-version: 2 # You can adjust this version if needed + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Git + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" + + - name: Add label and request review + run: | + reviewers="@cryostatio/reviewers" + pr_number=${{ github.event.issue.number }} + + echo "Adding label 'review-requested' to the PR" + gh pr edit $pr_number --add-label "review-requested" + + if [ -n "$reviewers" ]; then + gh pr request-review $pr_number --reviewer $reviewers + else + echo "Requesting review from @cryostatio/reviewer(s) team" + gh pr request-review $pr_number --team cryostatio/reviewer(s) + fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Remove label on review + run: | + pr_number=${{ github.event.issue.number }} + reviews_status=$(gh pr list --json state,reviews -q ".[] | select(.number == $pr_number) | .reviews[].state") + if [[ -n "$reviews_status" ]]; then + echo "Changes requested, removing 'review-requested' label" + gh pr edit $pr_number --remove-label "review-requested" + fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/push-ci.yml b/.github/workflows/push-ci.yml index 74c10963ee..ac1bf08c2f 100644 --- a/.github/workflows/push-ci.yml +++ b/.github/workflows/push-ci.yml @@ -18,49 +18,49 @@ jobs: checkout-repo: ${{ github.event.pull_request.head.repo.full_name }} checkout-ref: ${{ github.event.pull_request.head.ref }} secrets: inherit - if: github.repository_owner == 'cryostatio' + #if: github.repository_owner == 'cryostatio' build-and-test-amd64: uses: ./.github/workflows/ci-build-image.yml secrets: inherit with: build-arch: amd64 - if: github.repository_owner == 'cryostatio' + #if: github.repository_owner == 'cryostatio' build-and-test-arm64: uses: ./.github/workflows/ci-build-image.yml secrets: inherit with: build-arch: arm64 skip-itests: true - if: github.repository_owner == 'cryostatio' + #if: github.repository_owner == 'cryostatio' push-to-quay: runs-on: ubuntu-latest needs: [code-analysis, build-and-test-amd64, build-and-test-arm64] env: CRYOSTAT_IMG: quay.io/cryostat/cryostat - if: always() && github.repository_owner == 'cryostatio' + #if: always() && github.repository_owner == 'cryostatio' steps: - uses: actions/download-artifact@v3 with: name: cryostat-amd64 - if: github.repository_owner == 'cryostatio' + #if: github.repository_owner == 'cryostatio' - name: Load cryostat-amd64 image env: IMAGE_VERSION: ${{ needs.build-and-test-amd64.outputs.image-version }} run: | podman load -i cryostat-amd64.tar podman tag quay.io/cryostat/cryostat:latest $CRYOSTAT_IMG:$IMAGE_VERSION-linux-amd64 - if: github.repository_owner == 'cryostatio' + #if: github.repository_owner == 'cryostatio' - uses: actions/download-artifact@v3 with: name: cryostat-arm64 - if: github.repository_owner == 'cryostatio' + #if: github.repository_owner == 'cryostatio' - name: Load cryostat-arm64 image env: IMAGE_VERSION: ${{ needs.build-and-test-arm64.outputs.image-version }} run: | podman load -i cryostat-arm64.tar podman tag quay.io/cryostat/cryostat:latest $CRYOSTAT_IMG:$IMAGE_VERSION-linux-arm64 - if: github.repository_owner == 'cryostatio' + #if: github.repository_owner == 'cryostatio' - name: Create OCI Manifest id: create-manifest env: @@ -75,7 +75,7 @@ jobs: else echo "::set-output name=tags::$IMAGE_VERSION" fi - if: github.repository_owner == 'cryostatio' + #if: github.repository_owner == 'cryostatio' - name: Push to quay.io uses: redhat-actions/push-to-registry@v2 with: @@ -84,7 +84,7 @@ jobs: registry: quay.io/cryostat username: cryostat+bot password: ${{ secrets.REGISTRY_PASSWORD }} - if: github.repository_owner == 'cryostatio' + #if: github.repository_owner == 'cryostatio' - name: Print image URL run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" - if: github.repository_owner == 'cryostatio' + #if: github.repository_owner == 'cryostatio' diff --git a/.github/workflows/semantic-pr.yml b/.github/workflows/semantic-pr.yml index c5c8a5df17..24b2a50bab 100644 --- a/.github/workflows/semantic-pr.yml +++ b/.github/workflows/semantic-pr.yml @@ -15,3 +15,4 @@ jobs: - uses: amannn/action-semantic-pull-request@v3.4.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +#