-
Notifications
You must be signed in to change notification settings - Fork 30
chore: New manual GitHub Action to diff bundled outputs #2489
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
base: master
Are you sure you want to change the base?
Conversation
Deploying atlantis with
|
Latest commit: |
530a38f
|
Status: | ✅ Deploy successful! |
Preview URL: | https://7aa866f3.atlantis.pages.dev |
Branch Preview URL: | https://cleanup-git-diff-action.atlantis.pages.dev |
51060f2
to
be99164
Compare
@@ -0,0 +1,69 @@ | |||
name: Diff Outputs | |||
|
|||
on: workflow_dispatch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a manual action because we don't need to run it on every PR. It'll show up here after this merges: https://github.com/GetJobber/atlantis/actions
|
||
# Unignore dist directories and stage them to commit later | ||
sed -i '/\<dist\>/d' .gitignore | ||
git add -A |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should force add them with -f
instead of modifying the .gitignore
file
git config --global user.email "[email protected]" | ||
|
||
- name: Check for differences in built assets | ||
run: | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about having set -e
at the top of the script so that if something like npm ci
fails it will exit out quickly?
|
||
- name: Check for differences in built assets | ||
run: | | ||
clean_dist() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also wondering if it would be more readable if this was broken up into more name/run commands? You have lots of echo statements so it is still fairly easy to follow and I feel less strongly about this one.
Motivations
This PR adds a new manually-triggered GitHub Action that diffs the outputs of our packages on a given branch.
If you're testing a PR... let's say a dependabot version bump of some dependency... and you're not sure whether it's safe to ship because it could affect the final built assets that we ship, THIS ACTION IS FOR YOU!
Simply run this GH Action against your branch and you'll see one of two things:
✅ No differences found in built assets!
OR
👉 Please investigate the differences above to see if they are expected.
If you see the latter warning, look above it and you'll see a git diff showing what exactly changed. Usually it will be something within a
dist
directory in one of the packages. Just review the diff to see if it makes sense and whether it's safe to ship OR if you need to do more testing, then do that!Changes
Added
Testing
No need to test, I ran this on this PR a few times.
When there's no changes
https://github.com/GetJobber/atlantis/actions/runs/14503388190
When there are changes
https://github.com/GetJobber/atlantis/actions/runs/14503583543/job/40688621884
Changes can be tested via Pre-release