Fix PR workflow by chaining actions
| @@ -39,9 +39,13 @@ jobs: | |||
| 39 | 39 | ||
| 40 | label-by-branches: | 40 | label-by-branches: |
| 41 | name: 🏷️ Label PR by Branches | 41 | name: 🏷️ Label PR by Branches |
| 42 | needs: [label-by-size] | ||
| 42 | runs-on: ubuntu-latest | 43 | runs-on: ubuntu-latest |
| 44 | # Run, even if the previous jobs were skipped/failed | ||
| 43 | # Only label once when PR is created or branches are changed, to allow manual label removal | 45 | # Only label once when PR is created or branches are changed, to allow manual label removal |
| 44 | if: github.event.action == 'opened' || (github.event.action == 'synchronize' && (github.event.changes.base || github.event.changes.head)) | 46 | if: | |
| 47 | always() | ||
| 48 | && github.event.action == 'opened' || (github.event.action == 'synchronize' && (github.event.changes.base || github.event.changes.head)) | ||
| 45 | 49 | ||
| 46 | steps: | 50 | steps: |
| 47 | - name: Checkout Repository | 51 | - name: Checkout Repository |
| @@ -59,7 +63,10 @@ jobs: | |||
| 59 | 63 | ||
| 60 | label-by-files: | 64 | label-by-files: |
| 61 | name: 🏷️ Label PR by Files | 65 | name: 🏷️ Label PR by Files |
| 66 | needs: [label-by-branches] | ||
| 62 | runs-on: ubuntu-latest | 67 | runs-on: ubuntu-latest |
| 68 | # Run, even if the previous jobs were skipped/failed | ||
| 69 | if: always() | ||
| 63 | 70 | ||
| 64 | steps: | 71 | steps: |
| 65 | - name: Checkout Repository | 72 | - name: Checkout Repository |
| @@ -77,9 +84,12 @@ jobs: | |||
| 77 | 84 | ||
| 78 | remove-stale-label: | 85 | remove-stale-label: |
| 79 | name: 🗑️ Remove Stale Label on Comment | 86 | name: 🗑️ Remove Stale Label on Comment |
| 87 | needs: [label-by-files] | ||
| 80 | runs-on: ubuntu-latest | 88 | runs-on: ubuntu-latest |
| 81 | # Only runs when this is not done by the github actions bot | 89 | # Only runs when this is not done by the github actions bot |
| 82 | if: github.event_name == 'pull_request_review_comment' && github.actor != 'github-actions[bot]' | 90 | if: | |
| 91 | always() | ||
| 92 | && github.event_name == 'pull_request_review_comment' && github.actor != 'github-actions[bot]' | ||
| 83 | 93 | ||
| 84 | steps: | 94 | steps: |
| 85 | - name: Remove Stale Label | 95 | - name: Remove Stale Label |
| @@ -94,7 +104,7 @@ jobs: | |||
| 94 | 104 | ||
| 95 | check-merge-blocking-labels: | 105 | check-merge-blocking-labels: |
| 96 | name: 🚫 Check Merge Blocking Labels | 106 | name: 🚫 Check Merge Blocking Labels |
| 97 | needs: [label-by-branches, label-by-files] | 107 | needs: [label-by-size, label-by-branches, label-by-files, remove-stale-label] |
| 98 | runs-on: ubuntu-latest | 108 | runs-on: ubuntu-latest |
| 99 | # Run, even if the previous jobs were skipped/failed | 109 | # Run, even if the previous jobs were skipped/failed |
| 100 | if: always() | 110 | if: always() |
| @@ -144,7 +154,7 @@ jobs: | |||
| 144 | 154 | ||
| 145 | write-auto-comments: | 155 | write-auto-comments: |
| 146 | name: 💬 Post PR Comments Based on Labels | 156 | name: 💬 Post PR Comments Based on Labels |
| 147 | needs: [label-by-size, label-by-branches, label-by-files] | 157 | needs: [label-by-size, label-by-branches, label-by-files, remove-stale-label] |
| 148 | runs-on: ubuntu-latest | 158 | runs-on: ubuntu-latest |
| 149 | # Run, even if the previous jobs were skipped/failed | 159 | # Run, even if the previous jobs were skipped/failed |
| 150 | if: always() | 160 | if: always() |