From 5171ce26af22bc6a92aa3d30a038eb11f5d77cc1 Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Wed, 12 Apr 2023 10:57:46 +0100 Subject: [PATCH] TODO: Ensure build artifacts exist before diff --- .github/workflows/diff.yaml | 59 ------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 .github/workflows/diff.yaml diff --git a/.github/workflows/diff.yaml b/.github/workflows/diff.yaml deleted file mode 100644 index 54acebc021..0000000000 --- a/.github/workflows/diff.yaml +++ /dev/null @@ -1,59 +0,0 @@ -name: Diff changes to release - -on: - pull_request: - paths: ['package/release/**'] - -permissions: - pull-requests: write - -jobs: - generate-diff: - name: Generate Diff - runs-on: ubuntu-latest - # Abort if run from a fork, as token won't have write access to post comment - if: github.event.pull_request.head.repo.full_name == github.repository - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Need to also checkout the base branch to compare - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - cache: npm - node-version-file: .nvmrc - - - name: Set up diff drivers - run: | - npm install -g js-beautify - git config diff.minjs.textconv js-beautify - git config diff.mincss.textconv js-beautify - - - name: Generate diff - id: diff - run: | - git diff -M05 origin/$GITHUB_BASE_REF -- package/release \ - > $GITHUB_WORKSPACE/release.diff - - - name: Add comment to PR - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const fs = require('fs').promises - const diff = await fs.readFile( - process.env.GITHUB_WORKSPACE + '/release.diff', 'utf8' - ) - - const commentText = '## Changes to release\n' + - '```diff\n' + - diff + - '\n```' - - github.rest.issues.createComment({ - issue_number: context.payload.pull_request.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: commentText - })