From b5ca87109ea60233a7a65ab0a6bd36bb85a01691 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 14 Mar 2023 10:37:27 +1300 Subject: [PATCH 01/11] add minimum open time action for PRs --- .github/workflows/minimum-open-time.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/minimum-open-time.yml diff --git a/.github/workflows/minimum-open-time.yml b/.github/workflows/minimum-open-time.yml new file mode 100644 index 00000000..125af162 --- /dev/null +++ b/.github/workflows/minimum-open-time.yml @@ -0,0 +1,18 @@ +on: + - pull_request + - workflow_dispatch + # not sure about scheduling only on PRs. See https://github.com/orgs/community/discussions/49960 + # - schedule + # - cron: '0 * * * *' + +jobs: + require-minimum-open-time: + runs-on: ubuntu-latest + name: Require Minimum Open Time + steps: + - uses: actions/checkout@v2 + - uses: gregsdennis/minimum-open-time@main + with: + time: 2w # see below for options + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 70e4ad06e2a736d80a34b136b96ff0a30e8d5374 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 14 Mar 2023 10:42:31 +1300 Subject: [PATCH 02/11] add action name --- .github/workflows/minimum-open-time.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/minimum-open-time.yml b/.github/workflows/minimum-open-time.yml index 125af162..a8f2c6b3 100644 --- a/.github/workflows/minimum-open-time.yml +++ b/.github/workflows/minimum-open-time.yml @@ -1,3 +1,4 @@ +name: PR Policy on: - pull_request - workflow_dispatch From b56a9d39edf3b1cbde6d9ad4a8ad52d5da683a9e Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Fri, 17 Mar 2023 11:33:15 +1300 Subject: [PATCH 03/11] update cron to once daily; add PR condition on job --- .github/workflows/minimum-open-time.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/minimum-open-time.yml b/.github/workflows/minimum-open-time.yml index a8f2c6b3..b856bfce 100644 --- a/.github/workflows/minimum-open-time.yml +++ b/.github/workflows/minimum-open-time.yml @@ -2,12 +2,13 @@ name: PR Policy on: - pull_request - workflow_dispatch - # not sure about scheduling only on PRs. See https://github.com/orgs/community/discussions/49960 - # - schedule - # - cron: '0 * * * *' + # scheduling only on PRs is not directly supported. See https://github.com/orgs/community/discussions/49960 + - schedule + - cron: '0 0 * * *' # once daily jobs: require-minimum-open-time: + if: github.event_name == 'pull_request' runs-on: ubuntu-latest name: Require Minimum Open Time steps: From a88ac26aaadab6092d6793d7095ed6d06bf442fe Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 21 Mar 2023 08:44:54 +1300 Subject: [PATCH 04/11] move comment to different line --- .github/workflows/minimum-open-time.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/minimum-open-time.yml b/.github/workflows/minimum-open-time.yml index b856bfce..5c4cda13 100644 --- a/.github/workflows/minimum-open-time.yml +++ b/.github/workflows/minimum-open-time.yml @@ -4,7 +4,8 @@ on: - workflow_dispatch # scheduling only on PRs is not directly supported. See https://github.com/orgs/community/discussions/49960 - schedule - - cron: '0 0 * * *' # once daily + # once daily + - cron: '0 0 * * *' jobs: require-minimum-open-time: From b5b342f39cdf96dd3b9b8a5557fa049df5cacea8 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 21 Mar 2023 08:46:14 +1300 Subject: [PATCH 05/11] maybe just no comment --- .github/workflows/minimum-open-time.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/minimum-open-time.yml b/.github/workflows/minimum-open-time.yml index 5c4cda13..7899ee64 100644 --- a/.github/workflows/minimum-open-time.yml +++ b/.github/workflows/minimum-open-time.yml @@ -4,7 +4,6 @@ on: - workflow_dispatch # scheduling only on PRs is not directly supported. See https://github.com/orgs/community/discussions/49960 - schedule - # once daily - cron: '0 0 * * *' jobs: From 810846a7d860c625d9b0376e164cda9ead408e5a Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 21 Mar 2023 08:49:15 +1300 Subject: [PATCH 06/11] maybe bad yaml? --- .github/workflows/minimum-open-time.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/minimum-open-time.yml b/.github/workflows/minimum-open-time.yml index 7899ee64..8ed95581 100644 --- a/.github/workflows/minimum-open-time.yml +++ b/.github/workflows/minimum-open-time.yml @@ -1,9 +1,9 @@ name: PR Policy on: - - pull_request - - workflow_dispatch + pull_request + workflow_dispatch # scheduling only on PRs is not directly supported. See https://github.com/orgs/community/discussions/49960 - - schedule + schedule - cron: '0 0 * * *' jobs: From 9fb69c5e1623c66c1247f19fadcdbcea4b45d34c Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 21 Mar 2023 09:02:37 +1300 Subject: [PATCH 07/11] maybe it doesn't like the comment there --- .github/workflows/minimum-open-time.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/minimum-open-time.yml b/.github/workflows/minimum-open-time.yml index 8ed95581..cfe9de47 100644 --- a/.github/workflows/minimum-open-time.yml +++ b/.github/workflows/minimum-open-time.yml @@ -1,8 +1,8 @@ name: PR Policy +# scheduling only on PRs is not directly supported. See https://github.com/orgs/community/discussions/49960 on: pull_request workflow_dispatch - # scheduling only on PRs is not directly supported. See https://github.com/orgs/community/discussions/49960 schedule - cron: '0 0 * * *' From 18e58d6452602d2edb7b50903150edbced8e76ca Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 21 Mar 2023 09:03:33 +1300 Subject: [PATCH 08/11] indention maybe? --- .github/workflows/minimum-open-time.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/minimum-open-time.yml b/.github/workflows/minimum-open-time.yml index cfe9de47..3354bf95 100644 --- a/.github/workflows/minimum-open-time.yml +++ b/.github/workflows/minimum-open-time.yml @@ -4,7 +4,7 @@ on: pull_request workflow_dispatch schedule - - cron: '0 0 * * *' + - cron: '0 0 * * *' jobs: require-minimum-open-time: From 1525761bacfd94d76dc6ec77a3fe5f06db5e4392 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 21 Mar 2023 09:08:35 +1300 Subject: [PATCH 09/11] colons --- .github/workflows/minimum-open-time.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/minimum-open-time.yml b/.github/workflows/minimum-open-time.yml index 3354bf95..d2a99b60 100644 --- a/.github/workflows/minimum-open-time.yml +++ b/.github/workflows/minimum-open-time.yml @@ -1,10 +1,10 @@ name: PR Policy -# scheduling only on PRs is not directly supported. See https://github.com/orgs/community/discussions/49960 on: - pull_request - workflow_dispatch - schedule - - cron: '0 0 * * *' + - pull_request + - workflow_dispatch + # scheduling only on PRs is not directly supported. See https://github.com/orgs/community/discussions/49960 + - schedule: + - cron: '0 0 * * *' # once daily jobs: require-minimum-open-time: From e3ee2d6ac3d442b12f38ee8e68bc501f3aa80e95 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 21 Mar 2023 09:09:41 +1300 Subject: [PATCH 10/11] invalid type for 'on' --- .github/workflows/minimum-open-time.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/minimum-open-time.yml b/.github/workflows/minimum-open-time.yml index d2a99b60..f279bd8a 100644 --- a/.github/workflows/minimum-open-time.yml +++ b/.github/workflows/minimum-open-time.yml @@ -1,10 +1,10 @@ name: PR Policy on: - - pull_request - - workflow_dispatch + pull_request + workflow_dispatch # scheduling only on PRs is not directly supported. See https://github.com/orgs/community/discussions/49960 - - schedule: - - cron: '0 0 * * *' # once daily + schedule: + - cron: '0 0 * * *' # once daily jobs: require-minimum-open-time: From 2a7bd467289298469d66b1fde77046332fa6fd0e Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 21 Mar 2023 09:13:06 +1300 Subject: [PATCH 11/11] more colons --- .github/workflows/minimum-open-time.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/minimum-open-time.yml b/.github/workflows/minimum-open-time.yml index f279bd8a..0dfa1255 100644 --- a/.github/workflows/minimum-open-time.yml +++ b/.github/workflows/minimum-open-time.yml @@ -1,7 +1,7 @@ name: PR Policy on: - pull_request - workflow_dispatch + pull_request: + workflow_dispatch: # scheduling only on PRs is not directly supported. See https://github.com/orgs/community/discussions/49960 schedule: - cron: '0 0 * * *' # once daily