mui / mui-public

The public mono-repository of MUI (as an organization), see mui/mui-private for the opposite.
80 stars 16 forks source link

[infra] Move first batch of workflows to the public repo #186

Closed michelengelen closed 3 months ago

michelengelen commented 3 months ago

Title says it all.

The intention is to use them in the repos as reusable workflows to allow for a more convenient and aligned structure.

Example usage for "body cleanup" and "order id validation" in the mui-x repo:

name: Issue Cleanup and Order ID validation

on:
  issues:
    types:
      - opened

permissions: {}

jobs:
  issue_cleanup:
    name: Clean issue body
    uses: mui/mui-public/.github/workflows/issues_body-cleanup.yml@master
    permissions:
      contents: read
      issues: write
  order_id_validation:
    name: Validate order ID
    needs: issue_cleanup
    if: needs.issue_cleanup.outputs.orderId != ''
    uses: mui/mui-public/.github/workflows/issues_order-id-validation.yml@master
    with:
      orderId: ${{ needs.issue_cleanup.outputs.orderId }}
    permissions:
      contents: read
      issues: write
JCQuintas commented 3 months ago

Title says it all.

The intention is to use them in the repos as reusable workflows to allow for a more convenient and aligned structure.

Example usage for "body cleanup" and "order id validation" in the mui-x repo:

name: Issue Cleanup and Order ID validation

on:
  issues:
    types:
      - opened

permissions: {}

jobs:
  issue_cleanup:
    name: Clean issue body
    uses: mui/mui-public/.github/workflows/issues_body-cleanup.yml@master
    permissions:
      contents: read
      issues: write
  order_id_validation:
    name: Validate order ID
    needs: issue_cleanup
    if: needs.issue_cleanup.outputs.orderId != ''
    uses: mui/mui-public/.github/workflows/issues_order-id-validation.yml@master
    with:
      orderId: ${{ needs.issue_cleanup.outputs.orderId }}
    permissions:
      contents: read
      issues: write

If these two workflows are always meant to be run together, you can create the re-usable workflow to run them together with the correct logic, so the usage would be simpler

name: Issue Cleanup and Order ID validation

on:
  issues:
    types:
      - opened

permissions: {}

jobs:
  issue_cleanup_and_validation:
    name: Issue Cleanup and Order ID validation
    uses: mui/mui-public/.github/workflows/issues_body-cleanup-and-validation.yml@master
    permissions:
      contents: read
      issues: write
michelengelen commented 3 months ago

Title says it all. The intention is to use them in the repos as reusable workflows to allow for a more convenient and aligned structure. Example usage for "body cleanup" and "order id validation" in the mui-x repo:

name: Issue Cleanup and Order ID validation

on:
  issues:
    types:
      - opened

permissions: {}

jobs:
  issue_cleanup:
    name: Clean issue body
    uses: mui/mui-public/.github/workflows/issues_body-cleanup.yml@master
    permissions:
      contents: read
      issues: write
  order_id_validation:
    name: Validate order ID
    needs: issue_cleanup
    if: needs.issue_cleanup.outputs.orderId != ''
    uses: mui/mui-public/.github/workflows/issues_order-id-validation.yml@master
    with:
      orderId: ${{ needs.issue_cleanup.outputs.orderId }}
    permissions:
      contents: read
      issues: write

If these two workflows are always meant to be run together, you can create the re-usable workflow to run them together with the correct logic, so the usage would be simpler

name: Issue Cleanup and Order ID validation

on:
  issues:
    types:
      - opened

permissions: {}

jobs:
  issue_cleanup_and_validation:
    name: Issue Cleanup and Order ID validation
    uses: mui/mui-public/.github/workflows/issues_body-cleanup-and-validation.yml@master
    permissions:
      contents: read
      issues: write

That's exactly it ... they are not! :D

order id validation only happens on X, so any other repo would just use

name: Issue Cleanup and Order ID validation

on:
  issues:
    types:
      - opened

permissions: {}

jobs:
  issue_cleanup:
    name: Clean issue body
    uses: mui/mui-public/.github/workflows/issues_body-cleanup.yml@master
    permissions:
      contents: read
      issues: write

💪🏼

JCQuintas commented 3 months ago

other repo would just

Clearly I didn't think it through 🤣