Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add deep diffs to PRs #366

Merged
merged 14 commits into from
Aug 4, 2021
33 changes: 33 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,36 @@ jobs:
CONTENT_PATH: "/ipfs/${{ steps.cid-reader.outputs.CID }}/"
GIT_REVISION: ${{ github.sha }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: ./dockerized make diff
if: github.event_name == 'pull_request'
- uses: actions/upload-artifact@v2
if: github.event_name == 'pull_request'
with:
name: diff
path: diff

diff:
needs: persist
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: diff
- id: diff
run: |
body=$(cat diff | sed 's:`:\\`:g')
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo ::set-output name=diff::$body
- name: Create comment with the diff
uses: actions/github-script@v4
with:
script: |
await github.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.number }},
body: `${{ steps.diff.outputs.diff }}`
})
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ www
**/go.sum
**/go.mod
/versions
/diff

site/static/*.js
site/static/*.css
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export NODE_OPTIONS="--unhandled-rejections=strict"

all: deps releases all_dists site

DISTS = $(notdir $(wildcard dists/*))
Expand Down Expand Up @@ -34,6 +36,9 @@ site: deps
publish: deps all_dists site
./scripts/patch.js

diff:
./scripts/diff.js > diff

clean:
rm -rf releases
chmod -f -R u+w dists/*/gopath || true
Expand Down
Loading