-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: replace dist in git by diff comment (#152)
* remove dist from git * Add action to post dist CSS diff * test commit * test commit * test commit * test commit * test commit * test commit * test commit * test commit * test commit * test commit * test commit
- Loading branch information
Showing
28 changed files
with
56 additions
and
12,692 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
|
||
# Because we want to easily inspect the | ||
|
||
name: Post Diff Comment | ||
|
||
on: | ||
# Note! you can't safely use "pull_request_target" here | ||
# This workflow is mostly useful for "internal PRs" | ||
# External PRs won't be able to post a PR comment | ||
# See https://github.com/preactjs/compressed-size-action/issues/54 | ||
# See https://securitylab.github.com/research/github-actions-preventing-pwn-requests | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
post-diff-comment: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Compute dist diff | ||
id: dists | ||
run: | | ||
yarn install | ||
yarn workspace infima build | ||
mv packages/core/dist packages/core/dist-branch | ||
git fetch origin master | ||
git checkout master | ||
yarn workspace infima build | ||
yarn install | ||
DEFAULT_CSS_DIFF=$(git diff --no-index packages/core/dist/css/default/default.css packages/core/dist-branch/css/default/default.css | cat) | ||
# Escaping for multiline output support... see https://gh.neting.ccmunity/t/set-output-truncates-multiline-strings/16852/11 | ||
DEFAULT_CSS_DIFF="${DEFAULT_CSS_DIFF//'%'/'%25'}" | ||
DEFAULT_CSS_DIFF="${DEFAULT_CSS_DIFF//$'\n'/'%0A'}" | ||
DEFAULT_CSS_DIFF="${DEFAULT_CSS_DIFF//$'\r'/'%0D'}" | ||
echo "::set-output name=default-css-diff::$DEFAULT_CSS_DIFF" | ||
- uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
header: post-diff-comment | ||
message: | | ||
# Dist CSS Diff | ||
```diff | ||
${{ steps.dists.outputs.default-css-diff }} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,5 @@ yarn lint-staged | |
yarn workspace infima lint-staged | ||
|
||
yarn build | ||
git add packages/core/dist | ||
|
||
echo "pre-commit end" |
Oops, something went wrong.