Skip to content

Commit

Permalink
ci: create schema store reminder issue on release (#77)
Browse files Browse the repository at this point in the history
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->

## This PR
<!-- add the description of the PR here -->

- extends release please workflow to create a schema store reminder
issue on release

### Related Issues
<!-- add here the GitHub issue that this PR resolves if applicable -->

### Notes
<!-- any additional notes for this PR -->

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
<!-- anything that is related to this PR but not done here should be
noted under this section -->
<!-- if there is a need for a new issue, please link it here -->

### How to test
<!-- if applicable, add testing instructions under this section -->

---------

Signed-off-by: James Milligan <[email protected]>
  • Loading branch information
james-milligan authored Feb 2, 2023
1 parent 92c5186 commit cd646eb
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/schema-store-issue-template.md
Original file line number Diff line number Diff line change
@@ -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"
}
```
20 changes: 19 additions & 1 deletion .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit cd646eb

Please sign in to comment.