Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

michelengelen
Copy link
Member

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

@michelengelen michelengelen self-assigned this Aug 29, 2024
@michelengelen michelengelen added enhancement This is not a bug, nor a new feature scope: infra Org infrastructure work going on behind the scenes labels Aug 29, 2024
@michelengelen michelengelen enabled auto-merge (squash) August 29, 2024 12:39
@JCQuintas
Copy link
Member

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
Copy link
Member Author

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
Copy link
Member

other repo would just

Clearly I didn't think it through 🤣

@michelengelen michelengelen merged commit 36fe0a7 into mui:master Aug 29, 2024
5 checks passed
@michelengelen michelengelen deleted the automation/move-x-workflows-to-public branch August 29, 2024 13:48
@oliviertassinari oliviertassinari changed the title [infra] Moved first batch of workflows to the public repo [infra] Move first batch of workflows to the public repo Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is not a bug, nor a new feature scope: infra Org infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants