From f7225a13e354674fca0b70cf943fcc79a518d0f2 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 31 Aug 2023 18:12:50 -0700 Subject: [PATCH 01/32] Create check_release_notes.yml --- .github/workflows/check_release_notes.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/check_release_notes.yml diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml new file mode 100644 index 0000000..1531206 --- /dev/null +++ b/.github/workflows/check_release_notes.yml @@ -0,0 +1,22 @@ +# This workflow will triage pull requests and apply a label based on the +# paths that are modified in the pull request. +# +# To use this workflow, you will need to set up a .github/labeler.yml +# file with configuration. For more information, see: +# https://github.com/actions/labeler + +name: Labeler +on: + pull_request: + types: [labeled, unlabeled] + +jobs: + label: + + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + + steps: + - run: echo 'Label was ${{ github.event.pull_request.action }}!' From 3c6189c257629a401434861c1b78196b7cdaf135 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 31 Aug 2023 18:19:03 -0700 Subject: [PATCH 02/32] Update check_release_notes.yml --- .github/workflows/check_release_notes.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index 1531206..918f3d5 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -19,4 +19,14 @@ jobs: pull-requests: write steps: - - run: echo 'Label was ${{ github.event.pull_request.action }}!' + - name: Create comment + uses: peter-evans/create-or-update-comment@v3 + with: + issue-number: 1 + body: | + This is a multi-line test comment + - With GitHub **Markdown** :sparkles: + - Created by [create-or-update-comment][1] + + [1]: https://github.com/peter-evans/create-or-update-comment + reactions: '+1' From 4a2d75738164c0e2231079d1c5cefc43cf4f68fa Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 31 Aug 2023 18:21:21 -0700 Subject: [PATCH 03/32] Update check_release_notes.yml --- .github/workflows/check_release_notes.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index 918f3d5..a2b8e5f 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -19,14 +19,10 @@ jobs: pull-requests: write steps: - - name: Create comment + - name: Update comment uses: peter-evans/create-or-update-comment@v3 with: - issue-number: 1 + comment-id: 557858210 body: | - This is a multi-line test comment - - With GitHub **Markdown** :sparkles: - - Created by [create-or-update-comment][1] - - [1]: https://github.com/peter-evans/create-or-update-comment - reactions: '+1' + **Edit:** Some additional info + reactions: eyes From 56deb734210bd9bf533b33db21f191a5eaece477 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 31 Aug 2023 18:22:34 -0700 Subject: [PATCH 04/32] Update check_release_notes.yml --- .github/workflows/check_release_notes.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index a2b8e5f..a68f5d1 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -22,7 +22,6 @@ jobs: - name: Update comment uses: peter-evans/create-or-update-comment@v3 with: - comment-id: 557858210 body: | **Edit:** Some additional info reactions: eyes From 3dbf3697b0efa8c0fdae4571b9fedcbb1308678d Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 31 Aug 2023 18:24:22 -0700 Subject: [PATCH 05/32] Update check_release_notes.yml --- .github/workflows/check_release_notes.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index a68f5d1..a3828fa 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -22,6 +22,7 @@ jobs: - name: Update comment uses: peter-evans/create-or-update-comment@v3 with: + issue-number: 1 body: | **Edit:** Some additional info reactions: eyes From 4c52a7594fbcdbd6779bec6298cbb9cfb98b013f Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 10:02:39 -0700 Subject: [PATCH 06/32] Add more test workflow stuff --- .github/workflows/check_release_notes.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index a3828fa..a9718eb 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -19,10 +19,10 @@ jobs: pull-requests: write steps: - - name: Update comment - uses: peter-evans/create-or-update-comment@v3 - with: - issue-number: 1 - body: | - **Edit:** Some additional info - reactions: eyes + - name: Get PR labels + id: pr-labels + uses: joerick/pr-labels-action@v1.0.8 + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJSON(github) }} + run: echo "$GITHUB_CONTEXT" \ No newline at end of file From 7d35078afcb8aaa7aa7ebbb85bd99775f6ef2a9a Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 10:26:52 -0700 Subject: [PATCH 07/32] Add more test workflow stuff --- .github/workflows/check_release_notes.yml | 7 +++++-- check_release_notes.py | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 check_release_notes.py diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index a9718eb..782a0fb 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -8,7 +8,7 @@ name: Labeler on: pull_request: - types: [labeled, unlabeled] + types: [labeled, unlabeled, edited] jobs: label: @@ -25,4 +25,7 @@ jobs: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJSON(github) }} - run: echo "$GITHUB_CONTEXT" \ No newline at end of file + run: echo "$GITHUB_CONTEXT" + - name: Get env + id: pr-info + run: env \ No newline at end of file diff --git a/check_release_notes.py b/check_release_notes.py new file mode 100644 index 0000000..5fdec2b --- /dev/null +++ b/check_release_notes.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 + +import re +import sys +import json + +input_data = json.loads(sys.stdin.read()) +pr_body = input_data['body'] + +if result := re.search("(?<=```release-note\n).*?(?=\n```)", pr_body, re.DOTALL): + release_note = result.group().strip() + if not release_note: + print('FAIL: Release note is empty', file=sys.stderr) + sys.exit(-1) + if release_note.lower() == "tbd": + print('FAIL: Release note contains "TBD"', file=sys.stderr) + sys.exit(-1) +else: + print('FAIL: No release notes found in PR body', file=sys.stderr) + sys.exit(-1) + +sys.exit(0) \ No newline at end of file From 56c7cf10ce63fbaaa30d270d900da462ddd3f8ed Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 10:33:35 -0700 Subject: [PATCH 08/32] Add more test workflow stuff --- .github/workflows/check_release_notes.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index 782a0fb..acb020b 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -26,6 +26,6 @@ jobs: env: GITHUB_CONTEXT: ${{ toJSON(github) }} run: echo "$GITHUB_CONTEXT" - - name: Get env + - name: Get PR number id: pr-info - run: env \ No newline at end of file + run: echo ${{ github.event.number }} From c2785e6a5f49212a513c762de3722ac032c53e4e Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 10:47:16 -0700 Subject: [PATCH 09/32] Add more test workflow stuff --- .github/workflows/check_release_notes.yml | 2 +- check_release_notes.py | 36 +++++++++++++++-------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index acb020b..eaf4882 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -28,4 +28,4 @@ jobs: run: echo "$GITHUB_CONTEXT" - name: Get PR number id: pr-info - run: echo ${{ github.event.number }} + run: python3 check_release_notes.py ${{ github.repository }} ${{ github.event.number }} diff --git a/check_release_notes.py b/check_release_notes.py index 5fdec2b..b520bd9 100644 --- a/check_release_notes.py +++ b/check_release_notes.py @@ -1,22 +1,34 @@ #!/usr/bin/env python3 +import os import re import sys -import json -input_data = json.loads(sys.stdin.read()) -pr_body = input_data['body'] +import github -if result := re.search("(?<=```release-note\n).*?(?=\n```)", pr_body, re.DOTALL): - release_note = result.group().strip() - if not release_note: - print('FAIL: Release note is empty', file=sys.stderr) - sys.exit(-1) - if release_note.lower() == "tbd": - print('FAIL: Release note contains "TBD"', file=sys.stderr) +gh = github.Github() + +repo_name = os.getenv("GH_REPO") +pr_number = int(os.getenv("NUMBER")) + +repo = gh.get_repo(repo_name) +pr = repo.get_pull(pr_number) + +release_note_label = repo.get_label("release-note-required") + +if release_note_label in pr.labels: + if result := re.search("(?<=```release-note\n).*?(?=\n```)", pr.body, re.DOTALL): + release_note = result.group().strip() + if not release_note: + print('FAIL: Release note is empty', file=sys.stderr) + sys.exit(-1) + if release_note.lower() == "tbd": + print('FAIL: Release note contains "TBD"', file=sys.stderr) + sys.exit(-1) + else: + print('FAIL: No release notes found in PR body', file=sys.stderr) sys.exit(-1) else: - print('FAIL: No release notes found in PR body', file=sys.stderr) - sys.exit(-1) + print('INFO: no release note required', file=sys.stderr) sys.exit(0) \ No newline at end of file From a14569df5911436df717c47a213c13391efbb1a0 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 10:48:37 -0700 Subject: [PATCH 10/32] Add more test workflow stuff --- .github/workflows/check_release_notes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index eaf4882..382b6d8 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -28,4 +28,4 @@ jobs: run: echo "$GITHUB_CONTEXT" - name: Get PR number id: pr-info - run: python3 check_release_notes.py ${{ github.repository }} ${{ github.event.number }} + run: python3 check_release_notes.py From 3ad37540cc141294fb39ba1b37b89678fc013fe3 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 10:52:42 -0700 Subject: [PATCH 11/32] Add more test workflow stuff --- .github/workflows/check_release_notes.yml | 7 +++++-- check_release_notes.py | 0 2 files changed, 5 insertions(+), 2 deletions(-) mode change 100644 => 100755 check_release_notes.py diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index 382b6d8..d094fcb 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -8,7 +8,7 @@ name: Labeler on: pull_request: - types: [labeled, unlabeled, edited] + types: [labeled, unlabeled, edited, synchronize] jobs: label: @@ -26,6 +26,9 @@ jobs: env: GITHUB_CONTEXT: ${{ toJSON(github) }} run: echo "$GITHUB_CONTEXT" + - name: Check where we are + id: im-lost + run: pwd && ls -l - name: Get PR number id: pr-info - run: python3 check_release_notes.py + run: ./check_release_notes.py diff --git a/check_release_notes.py b/check_release_notes.py old mode 100644 new mode 100755 From bf36de698490c343b909eae049b9224d4b18b420 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 10:55:24 -0700 Subject: [PATCH 12/32] Add more test workflow stuff --- .github/workflows/check_release_notes.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index d094fcb..a4f533e 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -19,16 +19,10 @@ jobs: pull-requests: write steps: - - name: Get PR labels - id: pr-labels - uses: joerick/pr-labels-action@v1.0.8 - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJSON(github) }} - run: echo "$GITHUB_CONTEXT" - - name: Check where we are - id: im-lost - run: pwd && ls -l - - name: Get PR number - id: pr-info + - name: Checkout + uses: actions/checkout@v4 + with: + sparse-checkout: . + - name: Check Release Notes + id: release-notes run: ./check_release_notes.py From 4ae441cca2f1538865635ffaddad1b9566e766fb Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 10:56:31 -0700 Subject: [PATCH 13/32] Add more test workflow stuff --- .github/workflows/check_release_notes.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index a4f533e..f252b7c 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -23,6 +23,9 @@ jobs: uses: actions/checkout@v4 with: sparse-checkout: . + - name: Install GitHub Python module + id: gh-py-mod + run: python3 -m pip install -U github - name: Check Release Notes id: release-notes run: ./check_release_notes.py From 3b193bf75ee9491ca9610dd5015a6279bed65414 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 10:57:52 -0700 Subject: [PATCH 14/32] Add more test workflow stuff --- .github/workflows/check_release_notes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index f252b7c..ad2d488 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -25,7 +25,7 @@ jobs: sparse-checkout: . - name: Install GitHub Python module id: gh-py-mod - run: python3 -m pip install -U github + run: python3 -m pip install -U PyGithub - name: Check Release Notes id: release-notes run: ./check_release_notes.py From d8e22e101c8ece5396592b7b367ad5be7c39b615 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 11:01:33 -0700 Subject: [PATCH 15/32] Add more test workflow stuff --- .github/workflows/check_release_notes.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index ad2d488..34166b4 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -23,6 +23,9 @@ jobs: uses: actions/checkout@v4 with: sparse-checkout: . + - name: Get env + id: env + run: env | sort - name: Install GitHub Python module id: gh-py-mod run: python3 -m pip install -U PyGithub From d45b69322834c46153a8172505d3deb3078a63c4 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 11:03:31 -0700 Subject: [PATCH 16/32] Add more test workflow stuff --- .github/workflows/check_release_notes.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index 34166b4..645f2f1 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -26,6 +26,9 @@ jobs: - name: Get env id: env run: env | sort + - name: Get stuff + id: stuff + run: jq < $GITHUB_EVENT_PATH - name: Install GitHub Python module id: gh-py-mod run: python3 -m pip install -U PyGithub From d189fd5b7f60c5b85278d619a72456a16f48d460 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 11:06:15 -0700 Subject: [PATCH 17/32] Add more test workflow stuff --- check_release_notes.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/check_release_notes.py b/check_release_notes.py index b520bd9..a5250c1 100755 --- a/check_release_notes.py +++ b/check_release_notes.py @@ -3,13 +3,18 @@ import os import re import sys +import json import github +GITHUB_EVENT_PATH = os.getenv("GITHUB_EVENT_PATH") + +github_data = json.load(open(GITHUB_EVENT_PATH)) + gh = github.Github() repo_name = os.getenv("GH_REPO") -pr_number = int(os.getenv("NUMBER")) +pr_number = github_data['number'] repo = gh.get_repo(repo_name) pr = repo.get_pull(pr_number) From 4fd4fbbd4dd25676e1e974b9c38ef6f829261c52 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 11:09:48 -0700 Subject: [PATCH 18/32] Add more test workflow stuff --- check_release_notes.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/check_release_notes.py b/check_release_notes.py index a5250c1..deeb8be 100755 --- a/check_release_notes.py +++ b/check_release_notes.py @@ -7,13 +7,18 @@ import github -GITHUB_EVENT_PATH = os.getenv("GITHUB_EVENT_PATH") +def get_env(env_name): + value = os.getenv(env_name): + print(f"ENV {env_name} = {value}", file=sys.stdout) + return value + +GITHUB_EVENT_PATH = get_env("GITHUB_EVENT_PATH") github_data = json.load(open(GITHUB_EVENT_PATH)) gh = github.Github() -repo_name = os.getenv("GH_REPO") +repo_name = get_env("GH_REPO") pr_number = github_data['number'] repo = gh.get_repo(repo_name) From 34e818463cf9b45a13f4201f765bed3f782e6a66 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 11:10:16 -0700 Subject: [PATCH 19/32] Add more test workflow stuff --- check_release_notes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_release_notes.py b/check_release_notes.py index deeb8be..b3490d9 100755 --- a/check_release_notes.py +++ b/check_release_notes.py @@ -8,7 +8,7 @@ import github def get_env(env_name): - value = os.getenv(env_name): + value = os.getenv(env_name) print(f"ENV {env_name} = {value}", file=sys.stdout) return value From 50826aeba0c40d97ed4b4d6e0566aed4abc125e4 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 11:11:08 -0700 Subject: [PATCH 20/32] Add more test workflow stuff --- check_release_notes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_release_notes.py b/check_release_notes.py index b3490d9..aa954cd 100755 --- a/check_release_notes.py +++ b/check_release_notes.py @@ -18,7 +18,7 @@ def get_env(env_name): gh = github.Github() -repo_name = get_env("GH_REPO") +repo_name = get_env("GITHUB_REPOSITORY") pr_number = github_data['number'] repo = gh.get_repo(repo_name) From 7d6194e4fa9026a50361d2825eaa9fe9fca1af1e Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 11:19:18 -0700 Subject: [PATCH 21/32] Add more test workflow stuff --- check_release_notes.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/check_release_notes.py b/check_release_notes.py index aa954cd..dc9ac5d 100755 --- a/check_release_notes.py +++ b/check_release_notes.py @@ -12,7 +12,21 @@ def get_env(env_name): print(f"ENV {env_name} = {value}", file=sys.stdout) return value +def fail(message): + with open(GITHUB_RESULT_PATH, "a+") as output_file: + output_file.write(message + "\n") + print(f'FAIL: {message}', file=sys.stderr) + print(f'::error::{message}') + +def info(message): + with open(GITHUB_RESULT_PATH, "a+") as output_file: + output_file.write(message + "\n") + print(f'INFO: {message}', file=sys.stderr) + print(f'::notice::{message}') + + GITHUB_EVENT_PATH = get_env("GITHUB_EVENT_PATH") +GITHUB_RESULT_PATH = get_env("GITHUB_STEP_SUMMARY") github_data = json.load(open(GITHUB_EVENT_PATH)) @@ -30,15 +44,15 @@ def get_env(env_name): if result := re.search("(?<=```release-note\n).*?(?=\n```)", pr.body, re.DOTALL): release_note = result.group().strip() if not release_note: - print('FAIL: Release note is empty', file=sys.stderr) + fail('Release note is empty') sys.exit(-1) if release_note.lower() == "tbd": - print('FAIL: Release note contains "TBD"', file=sys.stderr) + fail('Release note contains "TBD"') sys.exit(-1) else: - print('FAIL: No release notes found in PR body', file=sys.stderr) + fail('No release notes found in PR body') sys.exit(-1) else: - print('INFO: no release note required', file=sys.stderr) + info('no release note required') sys.exit(0) \ No newline at end of file From 19fa9b3dc555a2f5ca3300de6a9b306cb21d602e Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 11:24:24 -0700 Subject: [PATCH 22/32] Add more test workflow stuff --- .github/workflows/check_release_notes.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index 645f2f1..1f0514c 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -23,12 +23,11 @@ jobs: uses: actions/checkout@v4 with: sparse-checkout: . - - name: Get env - id: env - run: env | sort - - name: Get stuff - id: stuff - run: jq < $GITHUB_EVENT_PATH + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' # caching pip dependencies - name: Install GitHub Python module id: gh-py-mod run: python3 -m pip install -U PyGithub From 4a8df0754faba09c87fa45c50f0875ecb5668bf6 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 11:26:13 -0700 Subject: [PATCH 23/32] Add more test workflow stuff --- .github/workflows/check_release_notes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index 1f0514c..b1b2a97 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -30,7 +30,7 @@ jobs: cache: 'pip' # caching pip dependencies - name: Install GitHub Python module id: gh-py-mod - run: python3 -m pip install -U PyGithub + run: python3 -m pip install -U -r requirements.txt - name: Check Release Notes id: release-notes run: ./check_release_notes.py From 03abdbd10c60839f7f41ce0364462c04b13202d0 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 11:26:42 -0700 Subject: [PATCH 24/32] Add more test workflow stuff --- requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..b393fb0 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +PyGithub \ No newline at end of file From ee704483614689e7cf18feb2faf7d104c310d68d Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 12:56:50 -0700 Subject: [PATCH 25/32] Add more test workflow stuff --- check_release_notes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/check_release_notes.py b/check_release_notes.py index dc9ac5d..73afd64 100755 --- a/check_release_notes.py +++ b/check_release_notes.py @@ -9,19 +9,19 @@ def get_env(env_name): value = os.getenv(env_name) - print(f"ENV {env_name} = {value}", file=sys.stdout) + # print(f"ENV {env_name} = {value}", file=sys.stdout) return value def fail(message): with open(GITHUB_RESULT_PATH, "a+") as output_file: output_file.write(message + "\n") - print(f'FAIL: {message}', file=sys.stderr) + # print(f'FAIL: {message}', file=sys.stderr) print(f'::error::{message}') def info(message): with open(GITHUB_RESULT_PATH, "a+") as output_file: output_file.write(message + "\n") - print(f'INFO: {message}', file=sys.stderr) + # print(f'INFO: {message}', file=sys.stderr) print(f'::notice::{message}') @@ -53,6 +53,6 @@ def info(message): fail('No release notes found in PR body') sys.exit(-1) else: - info('no release note required') + info('No release note required') sys.exit(0) \ No newline at end of file From df317d979efe5e6d538a3eeb6cae555f8e5e677c Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 13:49:39 -0700 Subject: [PATCH 26/32] Add new test action --- .github/workflows/check_release_notes.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index b1b2a97..ccc2c89 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -19,6 +19,8 @@ jobs: pull-requests: write steps: + - name: Test New Action + uses: danudey/check-release-notes@v0.1 - name: Checkout uses: actions/checkout@v4 with: From b6fde07a4506070d205f17d65e10b4d6001d2971 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 13:53:19 -0700 Subject: [PATCH 27/32] Add new test action --- .github/workflows/check_release_notes.yml | 32 +++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index ccc2c89..1de88cd 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -20,19 +20,19 @@ jobs: steps: - name: Test New Action - uses: danudey/check-release-notes@v0.1 - - name: Checkout - uses: actions/checkout@v4 - with: - sparse-checkout: . - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.12' - cache: 'pip' # caching pip dependencies - - name: Install GitHub Python module - id: gh-py-mod - run: python3 -m pip install -U -r requirements.txt - - name: Check Release Notes - id: release-notes - run: ./check_release_notes.py + uses: danudey/check-release-notes@v0.2 + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # sparse-checkout: . + # - name: Setup Python + # uses: actions/setup-python@v5 + # with: + # python-version: '3.12' + # cache: 'pip' # caching pip dependencies + # - name: Install GitHub Python module + # id: gh-py-mod + # run: python3 -m pip install -U -r requirements.txt + # - name: Check Release Notes + # id: release-notes + # run: ./check_release_notes.py From 09aca5c6417ee6273d7277fafe743ddfb4f5054e Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 14:02:10 -0700 Subject: [PATCH 28/32] Don't use a specified version --- .github/workflows/check_release_notes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index 1de88cd..4543fef 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Test New Action - uses: danudey/check-release-notes@v0.2 + uses: danudey/check-release-notes # - name: Checkout # uses: actions/checkout@v4 # with: From 0427e4e5f68c1004efd9ae5b37b1cb45d326a346 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Thu, 4 Jul 2024 14:02:58 -0700 Subject: [PATCH 29/32] Use master --- .github/workflows/check_release_notes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml index 4543fef..7cd5c5e 100644 --- a/.github/workflows/check_release_notes.yml +++ b/.github/workflows/check_release_notes.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Test New Action - uses: danudey/check-release-notes + uses: danudey/check-release-notes@main # - name: Checkout # uses: actions/checkout@v4 # with: From 361e4b50feb0d775a2304987f8133a1d8fdc9cb1 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Wed, 21 Aug 2024 15:05:30 -0700 Subject: [PATCH 30/32] Test a new thing --- .github/workflows/check_random_status.yml | 39 +++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/check_random_status.yml diff --git a/.github/workflows/check_random_status.yml b/.github/workflows/check_random_status.yml new file mode 100644 index 0000000..7aee70a --- /dev/null +++ b/.github/workflows/check_random_status.yml @@ -0,0 +1,39 @@ +name: Status-er +on: + pull_request: + types: [labeled, unlabeled, edited, synchronize] + +jobs: + label: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: Set PR Status to pending + uses: teamniteo/pull_request_status_action@v1.0.0 + with: + # Pull Request number (Mandatory) + pr_number: 3 + + # State to apply (Mandatory) + # Any of the (error | failure | pending | success) states + state: pending + + # Name of the repository in {organization}/{repo_name} format (Mandatory) + repository: danudey/pystrptime + + # Name to identify the Status (Optional) + # Defaults to `default` + context: default + + # The target URL to associate with the Status (Optional) + # This URL will be linked from the Github UI to allow users to easily see the source of the status. + target_url: https://example.target_url.com + + # A short description of the status (Optional) + description: "An example description" + + env: + # Default Github Token + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 97f701abd719b2d3a2b90fb0ad5fcc92eccb7bbb Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Wed, 21 Aug 2024 15:06:24 -0700 Subject: [PATCH 31/32] Test a new thing --- .github/workflows/check_random_status.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_random_status.yml b/.github/workflows/check_random_status.yml index 7aee70a..286a082 100644 --- a/.github/workflows/check_random_status.yml +++ b/.github/workflows/check_random_status.yml @@ -4,7 +4,7 @@ on: types: [labeled, unlabeled, edited, synchronize] jobs: - label: + statusit: runs-on: ubuntu-latest permissions: contents: read From c71e196803aa8401d5470afb96f96002579fee4e Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Wed, 21 Aug 2024 15:09:21 -0700 Subject: [PATCH 32/32] Remove garbage --- .github/workflows/check_random_status.yml | 39 ----------------------- 1 file changed, 39 deletions(-) delete mode 100644 .github/workflows/check_random_status.yml diff --git a/.github/workflows/check_random_status.yml b/.github/workflows/check_random_status.yml deleted file mode 100644 index 286a082..0000000 --- a/.github/workflows/check_random_status.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Status-er -on: - pull_request: - types: [labeled, unlabeled, edited, synchronize] - -jobs: - statusit: - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - steps: - - name: Set PR Status to pending - uses: teamniteo/pull_request_status_action@v1.0.0 - with: - # Pull Request number (Mandatory) - pr_number: 3 - - # State to apply (Mandatory) - # Any of the (error | failure | pending | success) states - state: pending - - # Name of the repository in {organization}/{repo_name} format (Mandatory) - repository: danudey/pystrptime - - # Name to identify the Status (Optional) - # Defaults to `default` - context: default - - # The target URL to associate with the Status (Optional) - # This URL will be linked from the Github UI to allow users to easily see the source of the status. - target_url: https://example.target_url.com - - # A short description of the status (Optional) - description: "An example description" - - env: - # Default Github Token - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file