-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
build: release preview package when triggered via comment #4750
Conversation
This pull request is being automatically deployed with Vercel (learn more). excalidraw – ./🔍 Inspect: https://vercel.com/excalidraw/excalidraw/7xJY3fQB5Z7vM4yt4W64PViXEugd excalidraw-package-example – ./src/packages/excalidraw🔍 Inspect: https://vercel.com/excalidraw/excalidraw-package-example/FnPvpSkQ6e45LHVTiWetN354dDTq |
- name: React to trigger comment | ||
uses: peter-evans/create-or-update-comment@v1 | ||
with: | ||
token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }} |
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 I think we should rename to EXCALIBOT_GITHUB_TOKEN
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.
is it even necessary? Shouldn't the default GITHUB_TOKEN
work when within the same repo?
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 intentional so that the reaction/comment is posted by excalibot and not github bot since we already have our bot which we are using for other things like translation, raising pull requests etc and in future also we can use it for more purposes + the commit is triggered by @excalibot trigger release
scripts/autorelease.js
Outdated
if (isPreview) { | ||
// use pullNumber-commithash as the version for preview | ||
const pullRequestNumber = process.argv.slice(3)[0]; | ||
pkg.version = `${pkg.version}-${pullRequestNumber}`; |
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.
Is the stable pkg.version
useful here?
I'd go with this format: pr-${pullRequestNumber}-${getShortCommitHash()}
(adding the pr-
prefix so it's clear what the first number is about)
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 will check if adding pr
prefix throws semver error, if it doesn't then will go ahead with pr.${pullRequestNumber}.${getShortCommitHash()}
as it should be in semver format else publish will throw error
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 not possible since in semantic version format major.minor.patch
, major
, minor
, patch
needs to be non negative numbers and in the minor
we can append string after -
in prerelease
https://github.com/ad1992/excalidraw/runs/5179631681?check_suite_focus=true
@excalidraw/excalidraw-preview
The release version will be
{pkg.version}-{commithash}-{pr number}
and github bot will post the version in comment as well #4750 (comment)As the
issue_comment
workflow only works in default branch (the workflow code gets triggered from master /main branch) hence tested it in my fork and it works fine ad1992#39Note: In my fork, I have added my
PAT
hence the thumbs up reaction and comment post release is posted by me