mirror of
https://github.com/danog/sass-site.git
synced 2024-11-26 12:04:40 +01:00
Fix diff link comment (#768)
This commit is contained in:
parent
063d1651d3
commit
8780d2cb7f
17
.github/workflows/shadow-repo-build.yml
vendored
17
.github/workflows/shadow-repo-build.yml
vendored
@ -28,13 +28,18 @@ jobs:
|
||||
name: site
|
||||
path: site.tar
|
||||
|
||||
diff-link:
|
||||
name: Comment
|
||||
prep-diff-link:
|
||||
name: Prep comment
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'pull_request' && github.event.action == 'opened'
|
||||
steps:
|
||||
- uses: peter-evans/create-or-update-comment@v3
|
||||
with:
|
||||
issue-number: ${{ github.event.number }}
|
||||
body: |
|
||||
- name: Save comment
|
||||
env:
|
||||
COMMENT: |
|
||||
View diff of compiled files (may take a few minutes): https://github.com/${{ vars.SHADOW_OWNER }}/${{ vars.SHADOW_REPO }}/compare/${{ github.event.pull_request.base.ref }}..${{ github.event.pull_request.head.ref }}
|
||||
run: |
|
||||
echo $COMMENT > ./comment.txt
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: comment
|
||||
path: comment.txt
|
||||
|
36
.github/workflows/shadow-repo-update.yml
vendored
36
.github/workflows/shadow-repo-update.yml
vendored
@ -45,27 +45,49 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'workflow_run'
|
||||
steps:
|
||||
- name: Clone shadow repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: ${{ vars.SHADOW_OWNER }}/${{ vars.SHADOW_REPO }}
|
||||
token: ${{ secrets.SASS_SITE_TOKEN }}
|
||||
ref: ${{ github.ref_name }}
|
||||
path: shadow-repo
|
||||
- name: Download built site
|
||||
uses: dawidd6/action-download-artifact@v2.27.0
|
||||
with:
|
||||
name: site
|
||||
run_id: ${{ github.event.workflow_run.id }}
|
||||
if_no_artifact_found: ignore
|
||||
- name: Clone shadow repo
|
||||
uses: actions/checkout@v3
|
||||
if: steps.download_comment.outputs.found_artifact == 'true'
|
||||
with:
|
||||
repository: ${{ vars.SHADOW_OWNER }}/${{ vars.SHADOW_REPO }}
|
||||
token: ${{ secrets.SASS_SITE_TOKEN }}
|
||||
ref: ${{ github.ref_name }}
|
||||
path: shadow-repo
|
||||
- name: Update shadow repo files
|
||||
if: steps.download_comment.outputs.found_artifact == 'true'
|
||||
run: |
|
||||
rm -rf shadow_repo/*
|
||||
tar xf site.tar
|
||||
cp -rT _site shadow_repo
|
||||
- uses: EndBug/add-and-commit@v9
|
||||
if: steps.download_comment.outputs.found_artifact == 'true'
|
||||
with:
|
||||
cwd: shadow-repo
|
||||
author_name: Sass Bot
|
||||
author_email: sass.bot.beep.boop@gmail.com
|
||||
message: Update from https://github.com/${{ github.repository }}/commit/${{ github.sha }}
|
||||
commit: --allow-empty
|
||||
|
||||
diff-link:
|
||||
name: Comment
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'workflow_run'
|
||||
steps:
|
||||
- name: Download comment text
|
||||
id: download_comment
|
||||
uses: dawidd6/action-download-artifact@v2.27.0
|
||||
with:
|
||||
name: comment
|
||||
run_id: ${{ github.event.workflow_run.id }}
|
||||
if_no_artifact_found: ignore
|
||||
- uses: peter-evans/create-or-update-comment@v3
|
||||
if: steps.download_comment.outputs.found_artifact == 'true'
|
||||
with:
|
||||
issue-number: ${{ github.event.number }}
|
||||
body_path: comment.txt
|
||||
|
Loading…
Reference in New Issue
Block a user