-
-
Notifications
You must be signed in to change notification settings - Fork 887
Auto versioning #1348
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
Auto versioning #1348
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,6 +19,9 @@ jobs: | |||||||||
| - name: Checkout | ||||||||||
| uses: actions/checkout@v5 | ||||||||||
| with: | ||||||||||
| # Check out the base branch (master) so we are on a real branch, not | ||||||||||
| # a detached PR merge ref, which makes git push work without arguments. | ||||||||||
| ref: ${{ github.event.pull_request.base.ref }} | ||||||||||
| # fetch-depth 2 so HEAD~1 resolves to the pre-merge master commit | ||||||||||
| fetch-depth: 2 | ||||||||||
| # Use a PAT so the pushed bump commit can trigger deploy.yml | ||||||||||
|
|
@@ -66,7 +69,10 @@ jobs: | |||||||||
|
|
||||||||||
| git config user.name "github-actions[bot]" | ||||||||||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||||||||||
| # Stage versioning files + any public/**/*.js whose dynamic import | ||||||||||
| # hashes may have been refreshed by updatePublicJsDynamicImportHashes | ||||||||||
| git add public/versioning.js package.json package-lock.json src/index.html | ||||||||||
| git add public/ 2>/dev/null || true | ||||||||||
|
||||||||||
| git add public/ 2>/dev/null || true | |
| if [ -d public ]; then | |
| git add public/ | |
| fi |
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.
Checking out the base branch ref is fine, but the workflow’s later use of
HEAD~1assumes the merge added exactly one commit tomaster(squash merge or a merge commit). If the repo ever uses “Rebase and merge” (multiple commits added),HEAD~1will point to another PR commit and the generated diff / base-version extraction will be wrong. Consider computing the pre-merge base SHA from the PR payload (e.g.,github.event.pull_request.base.sha) and diffing that against the post-merge tip, or otherwise handling rebase merges explicitly.