|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +name: Dev PR |
| 19 | + |
| 20 | +on: |
| 21 | + # TODO: Enable this when eps1lon/actions-label-merge-conflict is available. |
| 22 | + # push: |
| 23 | + # branches: |
| 24 | + # - master |
| 25 | + pull_request_target: |
| 26 | + types: |
| 27 | + - opened |
| 28 | + - edited |
| 29 | + - synchronize |
| 30 | + |
| 31 | +jobs: |
| 32 | + process: |
| 33 | + name: Process |
| 34 | + runs-on: ubuntu-latest |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v2 |
| 37 | + |
| 38 | + - name: Comment JIRA link |
| 39 | + if: | |
| 40 | + github.event_name == 'pull_request_target' && |
| 41 | + (github.event.action == 'opened' || |
| 42 | + github.event.action == 'edited') |
| 43 | + uses: actions/github-script@v3 |
| 44 | + with: |
| 45 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 46 | + script: | |
| 47 | + const script = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/dev_pr/link.js`); |
| 48 | + script({github, context}); |
| 49 | +
|
| 50 | + - name: Check title |
| 51 | + if: | |
| 52 | + github.event_name == 'pull_request_target' && |
| 53 | + (github.event.action == 'opened' || |
| 54 | + github.event.action == 'edited') |
| 55 | + uses: actions/github-script@v3 |
| 56 | + with: |
| 57 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 58 | + script: | |
| 59 | + const script = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/dev_pr/title_check.js`); |
| 60 | + script({github, context}); |
| 61 | +
|
| 62 | + - name: Assign GitHub labels |
| 63 | + if: | |
| 64 | + github.event_name == 'pull_request_target' && |
| 65 | + (github.event.action == 'opened' || |
| 66 | + github.event.action == 'synchronize') |
| 67 | + uses: actions/labeler@2.2.0 |
| 68 | + with: |
| 69 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 70 | + configuration-path: .github/workflows/dev_pr/labeler.yml |
| 71 | + sync-labels: true |
| 72 | + |
| 73 | + # TODO: Enable this when eps1lon/actions-label-merge-conflict is available. |
| 74 | + # - name: Checks if PR needs rebase |
| 75 | + # if: | |
| 76 | + # github.event_name == 'push' || |
| 77 | + # (github.event_name == 'pull_request_target' && |
| 78 | + # (github.event.action == 'opened' || |
| 79 | + # github.event.action == 'synchronize')) |
| 80 | + # uses: eps1lon/actions-label-merge-conflict@releases/2.x |
| 81 | + # with: |
| 82 | + # dirtyLabel: "needs-rebase" |
| 83 | + # repoToken: "${{ secrets.GITHUB_TOKEN }}" |
0 commit comments