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

Validate PR changes to make sure there are no changes missing #165

Merged
merged 9 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# check incoming pr's and make sure that
# - the code builds
# - the dist folder does not need updating
name: PR Check

on:
push:

pull_request:

jobs:
build-and-check-dist:
name: Run build and check dist folder
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: '20'

- name: Compile with NPM
run: |
npm ci
npm run compile
npm run package

- name: Check if there are changes that where not in the commit
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Found changes to commit after building. Here is the output from `git status`:"
git status

exit 1
else
echo "No changes found after compiling. PR is good for a review."
fi
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35066,7 +35066,7 @@ async function getPrFilesWithBlobSize(pullRequestNumber) {
: data;
const prFilesWithBlobSize = await Promise.all(files
// Cannot get blobs for files without sha (e.g. happens when only changing a permission bit on the file) or without blob_url (e.g. submodules)
.filter(file => file.sha != null && file.blob_url != null)
.filter(file => file.sha !== null && file.blob_url !== null)
.map(async (file) => {
const { filename, sha, patch } = file;
const { data: blob } = await octokit.rest.git.getBlob({
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ async function getPrFilesWithBlobSize(pullRequestNumber: number) {
const prFilesWithBlobSize = await Promise.all(
files
// Cannot get blobs for files without sha (e.g. happens when only changing a permission bit on the file) or without blob_url (e.g. submodules)
.filter(file => file.sha != null && file.blob_url != null)
.filter(file => file.sha !== null && file.blob_url !== null)
.map(async file => {
const {filename, sha, patch} = file;
const {data: blob} = await octokit.rest.git.getBlob({
Expand Down