From f3df0bef9a739289ba72ef2a892ca0879fdfe2c8 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Wed, 8 Nov 2023 07:59:36 -0500 Subject: [PATCH 1/4] Create diff-schema.yml Signed-off-by: 1000TurquoisePogs --- .github/workflows/diff-schema.yml | 42 +++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/diff-schema.yml diff --git a/.github/workflows/diff-schema.yml b/.github/workflows/diff-schema.yml new file mode 100644 index 0000000000..5bb327f2b0 --- /dev/null +++ b/.github/workflows/diff-schema.yml @@ -0,0 +1,42 @@ +name: Generate schema diff +on: + push: + branches: + - v1.x/rc + - v1.x/master + - v2.x/rc + - v2.x/master + - v3.x/rc + - v3.x/master + + workflow_dispatch: + inputs: + FROM_COMMIT: + description: 'Specify commit, branch or tag to diff from' + required: false + TO_COMMIT: + description: 'Specify commit, branch or tag to diff to' + required: false + +jobs: + diff: + runs-on: ubuntu-latest + steps: + - name: '[Prep 1] Checkout' + uses: actions/checkout@v2 + - name: '[Prep 2] Setup Node' + uses: actions/setup-node@v2 + with: + node-version: 18 + - name: '[Prep 3] Get to version' + run: node -e "const currentVersion = require('manifest.json.template').version; console.log('${{ github.event.inputs.TO_COMMIT }}'.length > 0 ? 'TO=${{ github.event.inputs.TO_COMMIT }}' : 'TO='+currentVersion);" >> $GITHUB_ENV + - name: '[Prep 4] Get from version' + run: node -e "if ('${{ github.event.inputs.FROM_COMMIT }}'.length > 0) { console.log('FROM=${{ github.event.inputs.FROM_COMMIT }}') } else { let parts = envs.TO_COMMIT.split('.'); parts[1]--; console.log('FROM='+parts.join('.')); }" >> $GITHUB_ENV + - name: '[Build] Make diff' + run: git diff ${{ envs.FROM }} ${{ envs.TO }} -- schemas > schemas.diff + - name: '[Upload]' + uses: actions/upload-artifact@v3 + with: + name: schemas.diff + path: schemas.diff + if-no-files-found: error From 63a67914838663aafb3ce7dfd06df53900ecbd46 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Wed, 8 Nov 2023 08:03:21 -0500 Subject: [PATCH 2/4] Update diff-schema.yml Signed-off-by: 1000TurquoisePogs --- .github/workflows/diff-schema.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/diff-schema.yml b/.github/workflows/diff-schema.yml index 5bb327f2b0..c5a66deb0a 100644 --- a/.github/workflows/diff-schema.yml +++ b/.github/workflows/diff-schema.yml @@ -29,7 +29,7 @@ jobs: with: node-version: 18 - name: '[Prep 3] Get to version' - run: node -e "const currentVersion = require('manifest.json.template').version; console.log('${{ github.event.inputs.TO_COMMIT }}'.length > 0 ? 'TO=${{ github.event.inputs.TO_COMMIT }}' : 'TO='+currentVersion);" >> $GITHUB_ENV + run: node -e "const currentVersion = require('manifest.json.template').version; if ('${{ github.event.inputs.TO_COMMIT }}'.length > 0) { console.log('TO=${{ github.event.inputs.TO_COMMIT }}'} else { console.log('TO='+currentVersion) }" >> $GITHUB_ENV - name: '[Prep 4] Get from version' run: node -e "if ('${{ github.event.inputs.FROM_COMMIT }}'.length > 0) { console.log('FROM=${{ github.event.inputs.FROM_COMMIT }}') } else { let parts = envs.TO_COMMIT.split('.'); parts[1]--; console.log('FROM='+parts.join('.')); }" >> $GITHUB_ENV - name: '[Build] Make diff' From f18443959f15594459b01765e004bef2088425e8 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Wed, 8 Nov 2023 08:52:53 -0500 Subject: [PATCH 3/4] Update diff-schema.yml Signed-off-by: 1000TurquoisePogs --- .github/workflows/diff-schema.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/diff-schema.yml b/.github/workflows/diff-schema.yml index c5a66deb0a..bbbe4c77fa 100644 --- a/.github/workflows/diff-schema.yml +++ b/.github/workflows/diff-schema.yml @@ -12,10 +12,10 @@ on: workflow_dispatch: inputs: FROM_COMMIT: - description: 'Specify commit, branch or tag to diff from' + description: 'Specify tag (v prefix) to diff from' required: false TO_COMMIT: - description: 'Specify commit, branch or tag to diff to' + description: 'Specify tag (v prefix) to diff to' required: false jobs: @@ -29,11 +29,11 @@ jobs: with: node-version: 18 - name: '[Prep 3] Get to version' - run: node -e "const currentVersion = require('manifest.json.template').version; if ('${{ github.event.inputs.TO_COMMIT }}'.length > 0) { console.log('TO=${{ github.event.inputs.TO_COMMIT }}'} else { console.log('TO='+currentVersion) }" >> $GITHUB_ENV + run: node -e "const fs = require('fs'); const currentVersion = JSON.parse(fs.readFileSync('./manifest.json.template', 'utf8')).version; if ('${{ github.event.inputs.TO_COMMIT }}'.length > 0) { console.log('TO=${{ github.event.inputs.TO_COMMIT }}')} else { console.log('TO=v'+currentVersion) }" >> $GITHUB_ENV - name: '[Prep 4] Get from version' - run: node -e "if ('${{ github.event.inputs.FROM_COMMIT }}'.length > 0) { console.log('FROM=${{ github.event.inputs.FROM_COMMIT }}') } else { let parts = envs.TO_COMMIT.split('.'); parts[1]--; console.log('FROM='+parts.join('.')); }" >> $GITHUB_ENV + run: node -e "if ('${{ github.event.inputs.FROM_COMMIT }}'.length > 0) { console.log('FROM=${{ github.event.inputs.FROM_COMMIT }}') } else { let parts = '${{ env.TO }}'.split('.'); parts[1]--; console.log('FROM='+parts.join('.')); }" >> $GITHUB_ENV - name: '[Build] Make diff' - run: git diff ${{ envs.FROM }} ${{ envs.TO }} -- schemas > schemas.diff + run: git diff ${{ env.FROM }} ${{ env.TO }} -- schemas > schemas.diff - name: '[Upload]' uses: actions/upload-artifact@v3 with: From 34f5405d16a0d0790492d8e3cdd848ff04375fd6 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Wed, 8 Nov 2023 09:09:47 -0500 Subject: [PATCH 4/4] Update diff-schema.yml Signed-off-by: 1000TurquoisePogs --- .github/workflows/diff-schema.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/diff-schema.yml b/.github/workflows/diff-schema.yml index bbbe4c77fa..ae8c8c4db7 100644 --- a/.github/workflows/diff-schema.yml +++ b/.github/workflows/diff-schema.yml @@ -2,11 +2,8 @@ name: Generate schema diff on: push: branches: - - v1.x/rc - v1.x/master - - v2.x/rc - v2.x/master - - v3.x/rc - v3.x/master workflow_dispatch: @@ -24,6 +21,8 @@ jobs: steps: - name: '[Prep 1] Checkout' uses: actions/checkout@v2 + with: + fetch-depth: '0' - name: '[Prep 2] Setup Node' uses: actions/setup-node@v2 with: