GH-7: Foobar #16
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
| # Licensed to the Apache Software Foundation (ASF) under one | |
| # or more contributor license agreements. See the NOTICE file | |
| # distributed with this work for additional information | |
| # regarding copyright ownership. The ASF licenses this file | |
| # to you under the Apache License, Version 2.0 (the | |
| # "License"); you may not use this file except in compliance | |
| # with the License. You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, | |
| # software distributed under the License is distributed on an | |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| # KIND, either express or implied. See the License for the | |
| # specific language governing permissions and limitations | |
| # under the License. | |
| name: Dev PR | |
| on: | |
| pull_request_target: | |
| types: | |
| - labeled | |
| - unlabeled | |
| - opened | |
| - edited | |
| - reopened | |
| - synchronize | |
| - ready_for_review | |
| - review_requested | |
| concurrency: | |
| group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| pr-label: | |
| name: "Ensure PR format" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Ensure PR is labeled | |
| env: | |
| LABELS: ${{ toJson(github.event.pull_request.labels) }} | |
| run: | | |
| if ! echo "$LABELS" | jq -e '.[] | select(.name | IN("bug-fix", "dependencies", "enhancement")) | .name'; then | |
| echo "Label the PR with one or more of:" | |
| echo "- bug-fix" | |
| echo "- dependencies" | |
| echo "- enhancement" | |
| echo | |
| echo "Also, add 'breaking-change' if appropriate." | |
| exit 1 | |
| else | |
| echo "Pull request is labeled properly!" | |
| fi | |
| - name: Ensure PR title format | |
| env: | |
| TITLE: ${{ toJson(github.event.pull_request.title) }} | |
| run: | | |
| if echo "$TITLE" | grep --extended-regexp "^MINOR: .*$" >/dev/null; then | |
| echo "This is a MINOR PR." | |
| elif echo "$TITLE" | grep --extended-regexp "^GH-[0-9]+: .*$" >/dev/null; then | |
| echo "This is a normal PR." | |
| else | |
| echo "PR title format is incorrect. Please see CONTRIBUTING.md." | |
| exit 1 | |
| fi |