Skip to content

Only run CI for non-draft PRs#2062

Open
nmvdw wants to merge 7 commits intoUniMath:masterfrom
nmvdw:CI
Open

Only run CI for non-draft PRs#2062
nmvdw wants to merge 7 commits intoUniMath:masterfrom
nmvdw:CI

Conversation

@nmvdw
Copy link
Copy Markdown
Collaborator

@nmvdw nmvdw commented Sep 24, 2025

This is taken from @fredrik-bakke, and the explanation is as follosw

Clause by clause:

  • github.event_name == 'workflow_dispatch': the job will run if it was manually dispatched.
  • github.event_name == 'push': the job will run if it was triggered by a push commit, e.g., when a commit is made to the master branch (note that you must specify your triggers in the on block, e.g., if the workflow is triggered on pushes to master or any other branch.)
  • (github.event_name == 'pull_request' && github.event.pull_request.draft == false): the job will run if it is triggered by a pull request commit and the pull request is not a draft

@nmvdw nmvdw marked this pull request as ready for review September 24, 2025 15:12
@nmvdw nmvdw marked this pull request as draft September 24, 2025 15:13
@nmvdw nmvdw marked this pull request as ready for review September 24, 2025 15:42
@nmvdw nmvdw marked this pull request as draft September 24, 2025 16:13
@nmvdw nmvdw marked this pull request as ready for review September 24, 2025 16:13
@nmvdw nmvdw marked this pull request as draft September 24, 2025 16:15
@nmvdw nmvdw marked this pull request as ready for review September 24, 2025 16:15
@nmvdw nmvdw marked this pull request as draft September 24, 2025 16:16
@nmvdw nmvdw marked this pull request as ready for review September 24, 2025 16:18
@nmvdw
Copy link
Copy Markdown
Collaborator Author

nmvdw commented Sep 24, 2025

This seems to work. So, the changes are as follows:

  • When a PR is a draft, the CI does not run
  • When a PR is marked 'ready for review', the CI runs

We can use this to save CI minutes if we incorporate the following policy:

  • PRs are draft by default
  • Even if a PR is a draft, we still give feedback if the author wants so

@rmatthes
Copy link
Copy Markdown
Member

This looks mostly good to me - I cannot check proper operations myself.
Concerning work with draft PR, I assume there is the general understanding that even a draft PR compiles fine - unless this is clearly mentioned even as reason for asking for advice. I wonder how to trigger CI manually for a life-long PR draft - for example when CI is used to show the others the error message of a failed compilation.

Comment thread .github/workflows/build-unimath.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants