From 1a61957b3f356de44d3832657bb63428de80b38d Mon Sep 17 00:00:00 2001 From: Simeon Widdis Date: Tue, 14 Feb 2023 15:09:03 -0800 Subject: [PATCH 1/5] Enforce labeling for release note generation Signed-off-by: Simeon Widdis --- .github/draft-release-notes-config.yml | 19 +++++++++---------- .github/workflows/enforce-labels.yml | 13 +++++++++++++ 2 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/enforce-labels.yml diff --git a/.github/draft-release-notes-config.yml b/.github/draft-release-notes-config.yml index 371f1b065..b9232d365 100644 --- a/.github/draft-release-notes-config.yml +++ b/.github/draft-release-notes-config.yml @@ -12,11 +12,17 @@ replacers: - search: '##' replace: '###' +exclude-labels: + - 'skip-changelog' + +exclude-contributors: + - 'opensearch-drigger-bot' + # Organizing the tagged PRs into unified categories categories: - title: 'Breaking Changes' labels: - - 'Breaking Changes' + - 'breaking' - title: 'Features' labels: - 'feature' @@ -28,18 +34,11 @@ categories: - 'bug' - title: 'Infrastructure' labels: - - 'infra' - - 'test' + - 'infrastructure' - 'dependencies' - - 'github actions' - title: 'Documentation' labels: - 'documentation' - title: 'Maintenance' labels: - - "version compatibility" - - "maintenance" - - title: 'Refactoring' - labels: - - 'refactor' - - 'code quality' + - 'maintenance' diff --git a/.github/workflows/enforce-labels.yml b/.github/workflows/enforce-labels.yml new file mode 100644 index 000000000..71d923f66 --- /dev/null +++ b/.github/workflows/enforce-labels.yml @@ -0,0 +1,13 @@ +name: Enforce PR labels + +on: + pull_request: + types: [labeled, unlabeled, opened, edited, synchronize] +jobs: + enforce-label: + runs-on: ubuntu-latest + steps: + - uses: yogevbd/enforce-label-action@2.1.0 + with: + REQUIRED_LABELS_ANY: "breaking,feature,enhancement,bug,infrastructure,dependencies,documentation,maintenance,skip-changelog" + REQUIRED_LABELS_ANY_DESCRIPTION: "A release label is required: ['breaking', 'bug', 'dependencies', 'documentation', 'enhancement', 'feature', 'infrastructure', 'maintenance', 'skip-changelog']" From c53062daca0911ce3a5548cd68fe831b31beb79d Mon Sep 17 00:00:00 2001 From: Simeon Widdis Date: Wed, 15 Feb 2023 10:41:24 -0800 Subject: [PATCH 2/5] Add auto-release workflow based on tagging Signed-off-by: Simeon Widdis --- .github/workflows/auto-release.yml | 29 ++++++++++++++++++++++++++++ .github/workflows/enforce-labels.yml | 26 ++++++++++++------------- 2 files changed, 42 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/auto-release.yml diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml new file mode 100644 index 000000000..d3b4fbcca --- /dev/null +++ b/.github/workflows/auto-release.yml @@ -0,0 +1,29 @@ +name: Releases + +on: + push: + tags: + - '*' + +jobs: + + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: GitHub App token + id: github_app_token + uses: tibdex/github-app-token@v1.5.0 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + installation_id: 22958780 + - name: Get tag + id: tag + uses: dawidd6/action-get-tag@v1 + - uses: actions/checkout@v2 + - uses: ncipollo/release-action@v1 + with: + github_token: ${{ steps.github_app_token.outputs.token }} + bodyFile: release-notes/opensearch=observability.release-notes-${{steps.tag.outputs.tag}}.md diff --git a/.github/workflows/enforce-labels.yml b/.github/workflows/enforce-labels.yml index 71d923f66..6c4ce7d79 100644 --- a/.github/workflows/enforce-labels.yml +++ b/.github/workflows/enforce-labels.yml @@ -1,13 +1,13 @@ -name: Enforce PR labels - -on: - pull_request: - types: [labeled, unlabeled, opened, edited, synchronize] -jobs: - enforce-label: - runs-on: ubuntu-latest - steps: - - uses: yogevbd/enforce-label-action@2.1.0 - with: - REQUIRED_LABELS_ANY: "breaking,feature,enhancement,bug,infrastructure,dependencies,documentation,maintenance,skip-changelog" - REQUIRED_LABELS_ANY_DESCRIPTION: "A release label is required: ['breaking', 'bug', 'dependencies', 'documentation', 'enhancement', 'feature', 'infrastructure', 'maintenance', 'skip-changelog']" +name: Enforce PR labels + +on: + pull_request: + types: [labeled, unlabeled, opened, edited, synchronize] +jobs: + enforce-label: + runs-on: ubuntu-latest + steps: + - uses: yogevbd/enforce-label-action@2.1.0 + with: + REQUIRED_LABELS_ANY: "breaking,feature,enhancement,bug,infrastructure,dependencies,documentation,maintenance,skip-changelog" + REQUIRED_LABELS_ANY_DESCRIPTION: "A release label is required: ['breaking', 'bug', 'dependencies', 'documentation', 'enhancement', 'feature', 'infrastructure', 'maintenance', 'skip-changelog']" From 4f0272eb85842fa19d2765470b7068e8fa38bbb0 Mon Sep 17 00:00:00 2001 From: Simeon Widdis Date: Wed, 15 Feb 2023 10:58:15 -0800 Subject: [PATCH 3/5] Correct spelling Signed-off-by: Simeon Widdis --- .github/draft-release-notes-config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/draft-release-notes-config.yml b/.github/draft-release-notes-config.yml index b9232d365..f21f3bfa7 100644 --- a/.github/draft-release-notes-config.yml +++ b/.github/draft-release-notes-config.yml @@ -16,7 +16,7 @@ exclude-labels: - 'skip-changelog' exclude-contributors: - - 'opensearch-drigger-bot' + - 'opensearch-trigger-bot' # Organizing the tagged PRs into unified categories categories: From b99c4b78b86b8d45f9169f6ac617fa07735c50bc Mon Sep 17 00:00:00 2001 From: Simeon Widdis Date: Thu, 16 Feb 2023 09:20:48 -0800 Subject: [PATCH 4/5] Fix excluding trigger-bot Signed-off-by: Simeon Widdis --- .github/draft-release-notes-config.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/draft-release-notes-config.yml b/.github/draft-release-notes-config.yml index f21f3bfa7..b900b171d 100644 --- a/.github/draft-release-notes-config.yml +++ b/.github/draft-release-notes-config.yml @@ -15,9 +15,6 @@ replacers: exclude-labels: - 'skip-changelog' -exclude-contributors: - - 'opensearch-trigger-bot' - # Organizing the tagged PRs into unified categories categories: - title: 'Breaking Changes' From b0fe5dbc22735d53240e4d663362c7c552bc37d0 Mon Sep 17 00:00:00 2001 From: Simeon Widdis Date: Thu, 23 Feb 2023 09:13:50 -0800 Subject: [PATCH 5/5] Fix release filename Signed-off-by: Simeon Widdis --- .github/workflows/auto-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index d3b4fbcca..5bf248df8 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -26,4 +26,4 @@ jobs: - uses: ncipollo/release-action@v1 with: github_token: ${{ steps.github_app_token.outputs.token }} - bodyFile: release-notes/opensearch=observability.release-notes-${{steps.tag.outputs.tag}}.md + bodyFile: release-notes/opensearch-observability.release-notes-${{steps.tag.outputs.tag}}.md