From e030dc4fcde7208043eaa0b4a88181b1b6bc9264 Mon Sep 17 00:00:00 2001 From: Emanuele Bartolesi Date: Tue, 16 Jan 2024 12:12:41 +0100 Subject: [PATCH 1/4] Update sample.json --- samples/ace-chat/assets/sample.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/samples/ace-chat/assets/sample.json b/samples/ace-chat/assets/sample.json index c2e6cac8..d9ae4e01 100644 --- a/samples/ace-chat/assets/sample.json +++ b/samples/ace-chat/assets/sample.json @@ -8,12 +8,6 @@ "longDescription": [ "This example shows how to build and ACE with multiple card and quick views allowing chat interaction with a Microsoft Teams channel." ], - "creationDateTime": "2021-09-07", - "updateDateTime": "2021-11-18", - "products": [ - "SharePoint", - "Viva" - ], "metadata": [ { "key": "CLIENT-SIDE-DEV", From aef3a861bf09d57cd928be9b0bf0bd1ca988a779 Mon Sep 17 00:00:00 2001 From: Emanuele Bartolesi Date: Tue, 16 Jan 2024 12:13:10 +0100 Subject: [PATCH 2/4] Update sample.json --- samples/ace-companynews/assets/sample.json | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/samples/ace-companynews/assets/sample.json b/samples/ace-companynews/assets/sample.json index e1320c13..b4f962e6 100644 --- a/samples/ace-companynews/assets/sample.json +++ b/samples/ace-companynews/assets/sample.json @@ -8,22 +8,6 @@ "longDescription": [ "This example shows an ACE which provides a news article rotator with Quick View for full article details. It shows previous/next buttons, and how to launch the Quick View for the current article. Additionally, you can like/unlike articles directly from the QuickView." ], - "creationDateTime": "2021-09-07", - "updateDateTime": "2021-11-18", - "products": [ - "SharePoint", - "Viva" - ], - "metadata": [ - { - "key": "CLIENT-SIDE-DEV", - "value": "TypeScript" - }, - { - "key": "SPFX-VERSION", - "value": "1.13.0" - } - ], "thumbnails": [ { "type": "image", @@ -60,4 +44,4 @@ } ] } -] \ No newline at end of file +] From e792d8c59cfd57148e9864bca3d284d065c760a0 Mon Sep 17 00:00:00 2001 From: Emanuele Bartolesi Date: Tue, 16 Jan 2024 12:14:13 +0100 Subject: [PATCH 3/4] Update validate-sample.yml --- .github/workflows/validate-sample.yml | 39 +++------------------------ 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/.github/workflows/validate-sample.yml b/.github/workflows/validate-sample.yml index 9a106d34..70904eff 100644 --- a/.github/workflows/validate-sample.yml +++ b/.github/workflows/validate-sample.yml @@ -1,4 +1,4 @@ -name: Sample.json validation +name: External validation on: pull_request: @@ -8,39 +8,8 @@ on: jobs: validate: runs-on: ubuntu-latest - outputs: - response: ${{ steps.fetch.outputs.response }} steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Fetch - if: ${{ hashFiles('**/samples.json') != '' }} - id: fetch - run: | - response=$(curl -X POST -H "Content-Type: application/json" -d @assets/samples.json https://m365-galleries.azurewebsites.net/Samples/validateSample); echo "response=$response" >> $GITHUB_OUTPUT - if [[ $(echo "$response" | jq -r '.isValid') == "true" ]]; then - echo "Validation successful! Proceeding with the pull request." - exit 0 - else - echo "Validation failed! Please fix the errors and try again." - exit 1 - fi - failure: - needs: validate - runs-on: ubuntu-latest - if: failure() - steps: - - name: Fail - run: | - echo ${{ needs.validate.outputs.response }} - - uses: actions/github-script@v6 + - name: Validate + uses: pnp/pnp-sample-validation@main with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: JSON.parse(`${{ needs.validate.outputs.response }}`).errors?.map(e => "- " + e).join("\n") - }) - - name: Fail - run: exit 1 \ No newline at end of file + gh-token: ${{ secrets.GITHUB_TOKEN }} From df0a4f6b8d0a7da02440c6fe4c200c2c015245a2 Mon Sep 17 00:00:00 2001 From: Emanuele Bartolesi Date: Tue, 16 Jan 2024 12:31:39 +0100 Subject: [PATCH 4/4] Update validate-sample.yml --- .github/workflows/validate-sample.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/validate-sample.yml b/.github/workflows/validate-sample.yml index 70904eff..0934ddbd 100644 --- a/.github/workflows/validate-sample.yml +++ b/.github/workflows/validate-sample.yml @@ -8,6 +8,9 @@ on: jobs: validate: runs-on: ubuntu-latest + permissions: + pull-requests: write + issues: write steps: - name: Validate uses: pnp/pnp-sample-validation@main