|
| 1 | +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node |
| 2 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions |
| 3 | + |
| 4 | +name: Auto Assign to Project(s) |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: [ master ] |
| 9 | + pull_request: |
| 10 | + branches: [ opened, labeled, master ] |
| 11 | + issues: |
| 12 | + types: [opened, labeled] |
| 13 | + #pull_request: |
| 14 | + # types: [opened, labeled] |
| 15 | +env: |
| 16 | + GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }} |
| 17 | + MY_GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }} |
| 18 | +jobs: |
| 19 | + build: |
| 20 | + |
| 21 | + runs-on: ubuntu-latest |
| 22 | + |
| 23 | + strategy: |
| 24 | + matrix: |
| 25 | + node-version: [10.x, 12.x, 14.x] |
| 26 | + |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v2 |
| 29 | + - name: Use Node.js ${{ matrix.node-version }} |
| 30 | + uses: actions/setup-node@v1 |
| 31 | + with: |
| 32 | + node-version: ${{ matrix.node-version }} |
| 33 | + - run: npm ci |
| 34 | + - run: npm run build --if-present |
| 35 | + - run: npm test |
| 36 | + |
| 37 | + assign_one_project: |
| 38 | + |
| 39 | + runs-on: ubuntu-latest |
| 40 | + name: Assign to One Project |
| 41 | + steps: |
| 42 | + - name: Assign NEW issues and NEW pull requests to CHILD project |
| 43 | + |
| 44 | + if: github.event.action == 'opened' |
| 45 | + with: |
| 46 | + project: 'https://github.com/elirehema/nbs-web/projects/2' |
| 47 | + |
| 48 | + - name: Assign issues and pull requests with `enhancement` label to CHILD project |
| 49 | + |
| 50 | + if: | |
| 51 | + contains(github.event.issue.labels.*.name, 'enhancement') || |
| 52 | + contains(github.event.pull_request.labels.*.name, 'enhancement') |
| 53 | + with: |
| 54 | + project: 'https://github.com/elirehema/nbs-web/projects/2' |
| 55 | + column_name: 'To do' |
| 56 | + - name: Assign NEW issues and NEW pull requests to HEADER project |
| 57 | + |
| 58 | + if: github.event.action == 'opened' |
| 59 | + with: |
| 60 | + project: 'https://github.com/users/elirehema/projects/2' |
| 61 | + |
| 62 | + - name: Assign issues and pull requests with `enhancement` label to HEADER project |
| 63 | + |
| 64 | + if: | |
| 65 | + contains(github.event.issue.labels.*.name, 'enhancement') || |
| 66 | + contains(github.event.pull_request.labels.*.name, 'enhancement') |
| 67 | + with: |
| 68 | + project: 'https://github.com/users/elirehema/projects/2' |
| 69 | + column_name: 'To do' |
| 70 | + |
0 commit comments