aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/automation.yml
blob: 2dc7fb5a3e8ef7c94305bb49bc3c009f7f8ed373 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Automation

on:
  push:
    branches:
      - master
  pull_request_target:
  issue_comment:

permissions: {}
jobs:
  label:
    name: Labeling
    runs-on: ubuntu-latest
    if: ${{ github.repository == 'jellyfin/jellyfin' }}
    steps:
      - name: Apply label
        uses: eps1lon/actions-label-merge-conflict@fd1f295ee7443d13745804bc49fe158e240f6c6e # tag=v2.1.0
        if: ${{ github.event_name == 'push' || github.event_name == 'pull_request_target'}}
        with:
          dirtyLabel: 'merge conflict'
          repoToken: ${{ secrets.JF_BOT_TOKEN }}

  project:
    name: Project board
    runs-on: ubuntu-latest
    if: ${{ github.repository == 'jellyfin/jellyfin' }}
    steps:
      - name: Remove from 'Current Release' project
        uses: alex-page/github-project-automation-plus@1f8873e97e3c8f58161a323b7c568c1f623a1c4d # tag=v0.8.2
        if: (github.event.pull_request || github.event.issue.pull_request) && !contains(github.event.*.labels.*.name, 'stable backport')
        continue-on-error: true
        with:
          project: Current Release
          action: delete
          repo-token: ${{ secrets.JF_BOT_TOKEN }}

      - name: Add to 'Release Next' project
        uses: alex-page/github-project-automation-plus@1f8873e97e3c8f58161a323b7c568c1f623a1c4d # tag=v0.8.2
        if: (github.event.pull_request || github.event.issue.pull_request) && github.event.action == 'opened'
        continue-on-error: true
        with:
          project: Release Next
          column: In progress
          repo-token: ${{ secrets.JF_BOT_TOKEN }}

      - name: Add to 'Current Release' project
        uses: alex-page/github-project-automation-plus@1f8873e97e3c8f58161a323b7c568c1f623a1c4d # tag=v0.8.2
        if: (github.event.pull_request || github.event.issue.pull_request) && !contains(github.event.*.labels.*.name, 'stable backport')
        continue-on-error: true
        with:
          project: Current Release
          column: In progress
          repo-token: ${{ secrets.JF_BOT_TOKEN }}

      - name: Check number of comments from the team member
        if: github.event.issue.pull_request == '' && github.event.comment.author_association == 'MEMBER'
        id: member_comments
        run: echo "::set-output name=number::$(curl -s ${{ github.event.issue.comments_url }} | jq '.[] | select(.author_association == "MEMBER") | .author_association' | wc -l)"

      - name: Move issue to needs triage
        uses: alex-page/github-project-automation-plus@1f8873e97e3c8f58161a323b7c568c1f623a1c4d # tag=v0.8.2
        if: github.event.issue.pull_request == '' && github.event.comment.author_association == 'MEMBER' && steps.member_comments.outputs.number <= 1
        continue-on-error: true
        with:
          project: Issue Triage for Main Repo
          column: Needs triage
          repo-token: ${{ secrets.JF_BOT_TOKEN }}

      - name: Add issue to triage project
        uses: alex-page/github-project-automation-plus@1f8873e97e3c8f58161a323b7c568c1f623a1c4d # tag=v0.8.2
        if: github.event.issue.pull_request == '' && github.event.action == 'opened'
        continue-on-error: true
        with:
          project: Issue Triage for Main Repo
          column: Pending response
          repo-token: ${{ secrets.JF_BOT_TOKEN }}