diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2021-06-07 10:17:11 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-07 10:17:11 -0400 |
| commit | cee8b87330916d382e223751e313be14bbddfdf4 (patch) | |
| tree | 7958afb226c70b65a4cfc771af415969aaf2fa9a /.github/workflows | |
| parent | 2b5762fc68438e4947fb15da838400da90751995 (diff) | |
| parent | 854a12b312f5d23007a4fe07bc996f443f48beb6 (diff) | |
Merge pull request #6137 from ferferga/actions
Refactor Github Actions
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/automation.yml | 24 | ||||
| -rw-r--r-- | .github/workflows/commands.yml (renamed from .github/workflows/check-backport.yml) | 25 | ||||
| -rw-r--r-- | .github/workflows/label-commenter.yml | 24 | ||||
| -rw-r--r-- | .github/workflows/merge-conflicts.yml | 17 | ||||
| -rw-r--r-- | .github/workflows/rebase.yml | 30 |
5 files changed, 41 insertions, 79 deletions
diff --git a/.github/workflows/automation.yml b/.github/workflows/automation.yml index 01998b852..8da2349c8 100644 --- a/.github/workflows/automation.yml +++ b/.github/workflows/automation.yml @@ -1,21 +1,31 @@ name: Automation on: + push: + branches: + - master pull_request_target: + issue_comment: jobs: - main: + label: + name: Labeling runs-on: ubuntu-latest steps: - - name: Does PR has the stable backport label? - uses: Dreamcodeio/does-pr-has-label@v1.2 - id: checkLabel + - name: Apply label + uses: eps1lon/actions-label-merge-conflict@v2.0.1 + if: ${{ github.event_name == 'push' || github.event_name == 'pull_request_target'}} with: - label: stable backport + dirtyLabel: 'merge conflict' + repoToken: ${{ secrets.JF_BOT_TOKEN }} + project: + name: Project board + runs-on: ubuntu-latest + steps: - name: Remove from 'Current Release' project uses: alex-page/github-project-automation-plus@v0.7.1 - if: (github.event.pull_request || github.event.issue.pull_request) && !steps.checkLabel.outputs.hasLabel + 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 @@ -33,7 +43,7 @@ jobs: - name: Add to 'Current Release' project uses: alex-page/github-project-automation-plus@v0.7.1 - if: (github.event.pull_request || github.event.issue.pull_request) && steps.checkLabel.outputs.hasLabel + 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 diff --git a/.github/workflows/check-backport.yml b/.github/workflows/commands.yml index 9ec58a331..e0b91ecee 100644 --- a/.github/workflows/check-backport.yml +++ b/.github/workflows/commands.yml @@ -1,4 +1,4 @@ -name: Stable Backport Check +name: Commands on: issue_comment: types: @@ -10,6 +10,29 @@ on: - synchronize jobs: + rebase: + name: Rebase + if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '@jellyfin-bot rebase') && github.event.comment.author_association == 'MEMBER' + runs-on: ubuntu-latest + steps: + - name: Notify as seen + uses: peter-evans/create-or-update-comment@v1.4.5 + with: + token: ${{ secrets.JF_BOT_TOKEN }} + comment-id: ${{ github.event.comment.id }} + reactions: '+1' + + - name: Checkout the latest code + uses: actions/checkout@v2 + with: + token: ${{ secrets.JF_BOT_TOKEN }} + fetch-depth: 0 + + - name: Automatic Rebase + uses: cirrus-actions/rebase@1.4 + env: + GITHUB_TOKEN: ${{ secrets.JF_BOT_TOKEN }} + check-backport: name: Check Backport if: ${{ ( github.event.issue.pull_request && contains(github.event.comment.body, '@jellyfin-bot check backport') ) || github.event.label.name == 'stable backport' || contains(github.event.pull_request.labels.*.name, 'stable backport' ) }} diff --git a/.github/workflows/label-commenter.yml b/.github/workflows/label-commenter.yml deleted file mode 100644 index 1d4eaaecd..000000000 --- a/.github/workflows/label-commenter.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Label Commenter - -on: - issues: - types: - - labeled - - unlabeled - pull_request_target: - types: - - labeled - - unlabeled - -jobs: - comment: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - with: - ref: master - - - name: Label Commenter - uses: peaceiris/actions-label-commenter@v1 - with: - github_token: ${{ secrets.JF_BOT_TOKEN }} diff --git a/.github/workflows/merge-conflicts.yml b/.github/workflows/merge-conflicts.yml deleted file mode 100644 index 1b04eab46..000000000 --- a/.github/workflows/merge-conflicts.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: 'Merge Conflicts' - -on: - push: - branches: - - master - pull_request_target: - types: - - synchronize -jobs: - triage: - runs-on: ubuntu-latest - steps: - - uses: eps1lon/actions-label-merge-conflict@v2.0.1 - with: - dirtyLabel: 'merge conflict' - repoToken: ${{ secrets.JF_BOT_TOKEN }} diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml deleted file mode 100644 index 8471f458e..000000000 --- a/.github/workflows/rebase.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Automatic Rebase -on: - issue_comment: - types: - - created - - edited - -jobs: - rebase: - name: Rebase - if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '@jellyfin-bot rebase') && github.event.comment.author_association == 'MEMBER' - runs-on: ubuntu-latest - steps: - - name: Notify as seen - uses: peter-evans/create-or-update-comment@v1.4.5 - with: - token: ${{ secrets.JF_BOT_TOKEN }} - comment-id: ${{ github.event.comment.id }} - reactions: '+1' - - - name: Checkout the latest code - uses: actions/checkout@v2 - with: - token: ${{ secrets.JF_BOT_TOKEN }} - fetch-depth: 0 - - - name: Automatic Rebase - uses: cirrus-actions/rebase@1.4 - env: - GITHUB_TOKEN: ${{ secrets.JF_BOT_TOKEN }} |
