diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 0c7f89c..845e5d9 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -101,6 +101,10 @@ jobs: PR_THREAD_COUNT=$(gh api repos/$GH_REPO/pulls/$PR_NUM/comments \ --jq '[.[] | select(.position != null)] | length') + COMMIT_COUNT="(gh api repos/$GH_REPO/pulls/$PR_NUM --jq '.commits')" + + CONTAINS_MASTER=$(gh api repos/$GH_REPO/pulls/$PR_NUM/commits --jq '.[1] | (.commit.author.email == "mclasen@redhat.com" and .commit.message == "Add some instructions")') + BLOCKED=0 comment_exists() { @@ -140,6 +144,16 @@ jobs: fi } + if [ "$CONTAINS_MASTER" = "true" ]; then + echo "PR contains commits from master branch" + BLOCKED=1 + fi + + if [ "$CONTAINS_MASTER" = "true" ]; then + echo "PR contains commits from master branch" + BLOCKED=1 + fi + if [ "$EXIT_CODE" -ne 0 ]; then echo "PR title validation failed" BLOCKED=1 @@ -230,6 +244,16 @@ jobs: bot, build BUILD_START_COMMENT_PARTIAL: "Starting a test build of the submission" + REVIEW_COMMENT: | + This pull request is temporarily marked as blocked as some + automated checks failed on it. Please make sure the + following are items are done: + + 1. The title of the pull request is `Add $FLATPAK_ID`. + 2. All [checklist items](https://github.com/flathub/flathub/blob/master/.github/pull_request_template.md) + in the pull request body are marked as complete. + 3. The pull request does not contain commits from the `master` + branch of [this repository](https://github.com/flathub/flathub/commits/master/). REVIEW_COMMENT: > This pull request is temporarily marked as blocked as some automated checks failed on it. Please make sure the pull