vitabaks / postgresql_cluster

PostgreSQL High-Availability Cluster (based on Patroni). Automating with Ansible.
https://postgresql-cluster.org
MIT License
1.69k stars 411 forks source link

Update of GitHub Actions to Prevent Triggering During Draft Pull Requests #418

Open ThomasSanson opened 1 year ago

ThomasSanson commented 1 year ago

Hello,

I have noticed that our GitHub Actions are currently being triggered even when pull requests are in draft mode. This may lead to an unnecessary usage of resources and potentially unwanted notifications.

I would like to propose that we update our GitHub Actions to prevent them from being triggered when pull requests are in draft mode. This could be achieved by adding a condition to our GitHub Actions workflows to check the status of the pull request.

Here is an example of how this could be implemented:

name: Workflow Name
...
jobs:
  build:
    if: '! github.event.pull_request.draft'
    runs-on: ubuntu-latest
...

In this example, the "build" job only runs if the pull request is not in draft mode.

I would be grateful to hear your thoughts on this proposal.