We've been using matrix jobs as required status checks. However, when
[DOC] pull requests are created, the matrix content and templated
variables are not executed, which results in changing the name of the
matrix jobs. Then required status checks are considered missing because
of the different names. So we can't merge [DOC] PRs right now.
This result is a known technique to check the composite status of
matrix jobs. https://github.com/orgs/community/discussions/26822
The result job is not only a non-matrix job, which doesn't have the
above problem, but also an independent job that is not skipped by [DOC]. needs works even if all dependent jobs are skipped, so this trick
works well.
This is also useful when we want to change the content of matrix. When
we change one, we usually have to update branches of old pull requests
so that they get newly required jobs. However, with this method, only result jobs are required, so you don't need to update old pull
requests.
I still don't like the fact that now you cannot visualize which matrix
jobs are "Required", but this seems like the best compromise.
Add result job for required status checks
We've been using matrix jobs as required status checks. However, when
[DOC] pull requests are created, the matrix content and templated
variables are not executed, which results in changing the name of the
matrix jobs. Then required status checks are considered missing because
of the different names. So we can't merge [DOC] PRs right now.
This
resultis a known technique to check the composite status ofmatrix jobs. https://github.com/orgs/community/discussions/26822
The
resultjob is not only a non-matrix job, which doesn't have theabove problem, but also an independent job that is not skipped by [DOC].
needsworks even if all dependent jobs are skipped, so this trickworks well.
This is also useful when we want to change the content of matrix. When
we change one, we usually have to update branches of old pull requests
so that they get newly required jobs. However, with this method, only
resultjobs are required, so you don't need to update old pullrequests.
I still don't like the fact that now you cannot visualize which matrix
jobs are "Required", but this seems like the best compromise.