Skip to content

Commit

Permalink
WIP: trying to apply an overlay before deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
paulRbr committed Mar 26, 2024
1 parent d7a17b5 commit c876f8e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Apply overlay to API document
run: |
npx bump-cli overlay apis/greenly-openapi-source.json overlays/greenly-tags.yaml > apis/greenly-openapi-public.json
- name: Comment pull request with API diff
uses: bump-sh/github-action@v1
with:
doc: greenly
token: ${{ secrets.GREENLY_BUMP_TOKEN }}
file: apis/greenly-openapi-source.json
file: apis/greenly-openapi-public.json
command: diff
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
31 changes: 31 additions & 0 deletions overlays/greenly-tags.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
overlay: 1.0.0
info:
title: Add tags and description to Greenly API
version: 0.0.1
actions:
- target: '$'
description: Add description to grouping tags.
update:
tags:
- name: "alternatives"
description: |
Everything about low-carbon alternatives
- name: "offsetProjects"
description: |
Find some carbon-offset related projects, only if you can't find a lower carbon alternative.
- name: "live"
description: |
Status of the API.
- name: "purchaseCategories"
description: |
Purchase categories is about purchasing.
- name: "transactions"
description: |
Compute the carbon footprint of your transactions.
- name: "users"
description: |
All endpoints to manage your users.
- target: "$..[?(@['tags'] && @['tags'].includes('ready'))]"
description: rename 'ready' tags into 'live' tags
update:
tags: ["live"]

0 comments on commit c876f8e

Please sign in to comment.