aa130c88da
* Update all * Pin p-retry due to ESM weirdness Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Travis Ralston <travisr@matrix.org>
92 lines
3.0 KiB
YAML
92 lines
3.0 KiB
YAML
name: Pull Request
|
|
on:
|
|
pull_request_target:
|
|
types: [ opened, edited, labeled, unlabeled, synchronize ]
|
|
workflow_call:
|
|
inputs:
|
|
labels:
|
|
type: string
|
|
default: "T-Defect,T-Deprecation,T-Enhancement,T-Task"
|
|
required: false
|
|
description: "No longer used, uses allchange logic now, will be removed at a later date"
|
|
secrets:
|
|
ELEMENT_BOT_TOKEN:
|
|
required: true
|
|
concurrency: ${{ github.workflow }}-${{ github.event.pull_request.head.ref }}
|
|
jobs:
|
|
changelog:
|
|
name: Preview Changelog
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: matrix-org/allchange@main
|
|
with:
|
|
ghToken: ${{ secrets.GITHUB_TOKEN }}
|
|
requireLabel: true
|
|
|
|
prevent-blocked:
|
|
name: Prevent Blocked
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pull-requests: read
|
|
steps:
|
|
- name: Add notice
|
|
uses: actions/github-script@v6
|
|
if: contains(github.event.pull_request.labels.*.name, 'X-Blocked')
|
|
with:
|
|
script: |
|
|
core.setFailed("Preventing merge whilst PR is marked blocked!");
|
|
|
|
community-prs:
|
|
name: Label Community PRs
|
|
runs-on: ubuntu-latest
|
|
if: github.event.action == 'opened'
|
|
steps:
|
|
- name: Check membership
|
|
uses: tspascoal/get-user-teams-membership@v1
|
|
id: teams
|
|
with:
|
|
username: ${{ github.event.pull_request.user.login }}
|
|
organization: matrix-org
|
|
team: Core Team
|
|
GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
|
|
|
- name: Add label
|
|
if: ${{ steps.teams.outputs.isTeamMember == 'false' }}
|
|
uses: actions/github-script@v6
|
|
with:
|
|
script: |
|
|
github.rest.issues.addLabels({
|
|
issue_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
labels: ['Z-Community-PR']
|
|
});
|
|
|
|
close-if-fork-develop:
|
|
name: Forbid develop branch fork contributions
|
|
runs-on: ubuntu-latest
|
|
if: >
|
|
github.event.action == 'opened' &&
|
|
github.event.pull_request.head.ref == 'develop' &&
|
|
github.event.pull_request.head.repo.full_name != github.repository
|
|
steps:
|
|
- name: Close pull request
|
|
uses: actions/github-script@v6
|
|
with:
|
|
script: |
|
|
github.rest.issues.createComment({
|
|
issue_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
body: "Thanks for opening this pull request, unfortunately we do not accept contributions from the main" +
|
|
" branch of your fork, please re-open once you switch to an alternative branch for everyone's sanity." +
|
|
" See https://github.com/matrix-org/matrix-js-sdk/blob/develop/CONTRIBUTING.md",
|
|
});
|
|
|
|
github.rest.pulls.update({
|
|
pull_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
state: 'closed'
|
|
});
|