From cd646eb29fc9c18d214ef319745a67a530899338 Mon Sep 17 00:00:00 2001 From: James Milligan <75740990+james-milligan@users.noreply.github.com> Date: Thu, 2 Feb 2023 15:09:37 +0000 Subject: [PATCH] ci: create schema store reminder issue on release (#77) ## This PR - extends release please workflow to create a schema store reminder issue on release ### Related Issues ### Notes When testing on a local branch a PAT was required, however this may not be the case dependent upon org setup. If we see a `HttpError: Resource not accessible by integration` error string we may need to generate a more permissive token for this action. ### Example issue #### chore: add json/json-schema-v0.1.5 to schema store JSON schema released with tag json/json-schema-v0.1.5. This needs to be added to the schema store catalog. [Schema store repo](https://github.com/SchemaStore/schemastore) Extend the catalog entry found in `src/api/json/catalog.json` to include the new version: ```diff { "name": "flagd flag configuration", "description": "Flag configuration for the OpenFeature spec compliant flagd provider", "fileMatch": [ "flagd.json", "flagd.yaml", "flagd.yml", "*.flagd.json", "*.flagd.yaml", "*.flagd.yml" ], "url": "https://raw.githubusercontent.com/open-feature/schemas/main/json/flagd-definitions.json", "versions": { "0.1.1": "https://raw.githubusercontent.com/open-feature/schemas/json/json-schema-v0.1.1/json/flagd-definitions.json", + "X.X.X": "https://raw.githubusercontent.com/open-feature/schemas/json/json-schema-vX.X.X/json/flagd-definitions.json" } ``` ### Follow-up Tasks ### How to test --------- Signed-off-by: James Milligan --- .github/schema-store-issue-template.md | 29 ++++++++++++++++++++++++++ .github/workflows/release-please.yaml | 20 +++++++++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .github/schema-store-issue-template.md diff --git a/.github/schema-store-issue-template.md b/.github/schema-store-issue-template.md new file mode 100644 index 0000000..0e29368 --- /dev/null +++ b/.github/schema-store-issue-template.md @@ -0,0 +1,29 @@ +--- +title: "chore: add {{ env.TAG }} to schema store" +--- + +JSON schema released with tag {{ env.TAG }}. +This needs to be added to the schema store catalog. + +[Schema store repo](https://github.com/SchemaStore/schemastore) + +Extend the catalog entry found in `src/api/json/catalog.json` to include the new version: + +```diff +{ + "name": "flagd flag configuration", + "description": "Flag configuration for the OpenFeature spec compliant flagd provider", + "fileMatch": [ + "flagd.json", + "flagd.yaml", + "flagd.yml", + "*.flagd.json", + "*.flagd.yaml", + "*.flagd.yml" + ], + "url": "https://raw.githubusercontent.com/open-feature/schemas/main/json/flagd-definitions.json", + "versions": { + "0.1.1": "https://raw.githubusercontent.com/open-feature/schemas/json/json-schema-v0.1.1/json/flagd-definitions.json", ++ "X.X.X": "https://raw.githubusercontent.com/open-feature/schemas/json/json-schema-vX.X.X/json/flagd-definitions.json" +} +``` \ No newline at end of file diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index dc9e079..c16e6ce 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -25,8 +25,9 @@ jobs: default-branch: main outputs: releases_created: ${{ steps.release.outputs.releases_created }} - # this is generated by release-please b/c this is in a manifest repo. + # these are generated by release-please b/c this is in a manifest repo. buf_release_tag: ${{ steps.release.outputs.protobuf--tag_name }} + json_release_tag: ${{ steps.release.outputs.json--tag_name }} push-module: needs: release-please @@ -43,3 +44,20 @@ jobs: # Push module to the BSR - name: bsr-push run: BUF_TOKEN="${{ secrets.BUF_TOKEN }}" buf push --tag "${{ needs.release-please.outputs.buf_release_tag }}" protobuf + + create-schema-store-issue: + needs: release-please + name: create schema release reminder issue + runs-on: ubuntu-latest + if: ${{ needs.release-please.outputs.releases_created && needs.release-please.outputs.json_release_tag }} + steps: + # Run `git checkout` + - uses: actions/checkout@v3 + with: + ref: ${{ needs.release-please.outputs.json_release_tag }} + - uses: JasonEtco/create-an-issue@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ needs.release-please.outputs.json_release_tag }} + with: + filename: .github/schema-store-issue-template.md