-
Notifications
You must be signed in to change notification settings - Fork 257
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
[STRATCONN-3673] - Minor fixes to github scripts and adds test instructions #1970
Conversation
@@ -1,21 +1,17 @@ | |||
// This is a github action script and can be run only from github actions. To run this script locally, you need to mock the github object and context object. | |||
module.exports = async ({ github, context, core, exec }) => { | |||
const { GITHUB_SHA, RELEASE_TAG } = process.env | |||
const { data } = await github.rest.search.commits({ | |||
q: `Publish repo:${context.repo.owner}/${context.repo.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.
Github search is unable to filter commits with just Publish
message. So, decided to use git cli itself for searching the recent two "Publish" commits.
const prs = await getPRsBetweenCommits(github, context, core, previousPublish, newPublish) | ||
|
||
const newReleaseTag = RELEASE_TAG | ||
// Get tag for the current release | ||
const newReleaseTag = await getReleaseTag(core, exec) |
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.
Also moved Get Release Tag step from publish.yml to this script. We can use a simple git command to extract the current release tag
scripts/github-action/TESTING.md
Outdated
|
||
The `release` job uses `create-github-release` script to compute changelog and creates a release. This job has dependency on `build-and-publish` job to finish publishing lerna packages. To test this job in local, comment on the [needs](https://github.com/segmentio/action-destinations/blob/6f55e6f051c214754f9fb9b213ddad6764ba3f18/.github/workflows/publish.yml#L61) attribute and run the following command. The PAT token used here should have permission to create release. When DRY_RUN is set to true, the `create-github-release` doesn't create a release and instead just prints the changelog. | ||
|
||
**Note:** When DRY_RUN is set to true, the workflow won't update the PR but instead just print the labels to be added or removed. |
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 this line needed? seems like it is more relevant to ## Testing compute-labels script
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.
That's just copy paste gone bad! Fixed it. Thanks for catching.
commit f530cc1 Author: Harsh Joshi <harsh.joshi@segment.com> Date: Mon Apr 8 14:45:23 2024 +0530 Update action name commit d56403a Author: Maryam Sharif <maryam.sharif@segment.com> Date: Fri Apr 5 10:50:47 2024 -0700 Publish - @segment/actions-shared@1.86.0 - @segment/browser-destination-runtime@1.35.0 - @segment/actions-core@3.105.0 - @segment/action-destinations@3.258.0 - @segment/destinations-manifest@1.49.0 - @segment/analytics-browser-actions-1flow@1.18.0 - @segment/analytics-browser-actions-adobe-target@1.36.0 - @segment/analytics-browser-actions-algolia-plugins@1.13.0 - @segment/analytics-browser-actions-amplitude-plugins@1.36.0 - @segment/analytics-browser-actions-braze-cloud-plugins@1.39.0 - @segment/analytics-browser-actions-braze@1.39.0 - @segment/analytics-browser-actions-bucket@1.16.0 - @segment/analytics-browser-actions-cdpresolution@1.23.0 - @segment/analytics-browser-actions-commandbar@1.36.0 - @segment/analytics-browser-actions-devrev@1.23.0 - @segment/analytics-browser-actions-friendbuy@1.36.0 - @segment/analytics-browser-actions-fullstory@1.38.0 - @segment/analytics-browser-actions-google-analytics-4@1.42.0 - @segment/analytics-browser-actions-google-campaign-manager@1.26.0 - @segment/analytics-browser-actions-heap@1.36.0 - @segment/analytics-browser-hubble-web@1.22.0 - @segment/analytics-browser-actions-hubspot@1.36.0 - @segment/analytics-browser-actions-intercom@1.37.0 - @segment/analytics-browser-actions-iterate@1.36.0 - @segment/analytics-browser-actions-jimo@1.24.0 - @segment/analytics-browser-actions-koala@1.36.0 - @segment/analytics-browser-actions-logrocket@1.36.0 - @segment/analytics-browser-actions-pendo-web-actions@1.25.0 - @segment/analytics-browser-actions-playerzero@1.36.0 - @segment/analytics-browser-actions-replaybird@1.17.0 - @segment/analytics-browser-actions-ripe@1.36.0 - @segment/analytics-browser-actions-rupt@1.25.0 - @segment/analytics-browser-actions-screeb@1.36.0 - @segment/analytics-browser-actions-utils@1.36.0 - @segment/analytics-browser-actions-snap-plugins@1.17.0 - @segment/analytics-browser-actions-sprig@1.36.0 - @segment/analytics-browser-actions-stackadapt@1.36.0 - @segment/analytics-browser-actions-survicate@1.12.0 - @segment/analytics-browser-actions-tiktok-pixel@1.33.0 - @segment/analytics-browser-actions-upollo@1.36.0 - @segment/analytics-browser-actions-userpilot@1.36.0 - @segment/analytics-browser-actions-vwo@1.37.0 - @segment/analytics-browser-actions-wiseops@1.36.0 commit d3a85b1 Author: maryamsharif <99763167+maryamsharif@users.noreply.github.com> Date: Fri Apr 5 10:44:44 2024 -0700 retlOnMappingSave Hook (#1969) * Merge branch hooks/retlOnMappingSave * Add unit tests * Address comments commit 35def89 Author: Joe Ayoub <joe.ayoub@segment.com> Date: Fri Apr 5 11:07:50 2024 +0100 Publish - @segment/actions-shared@1.85.0 - @segment/browser-destination-runtime@1.34.0 - @segment/actions-core@3.104.0 - @segment/action-destinations@3.257.0 - @segment/destinations-manifest@1.48.0 - @segment/analytics-browser-actions-1flow@1.17.0 - @segment/analytics-browser-actions-adobe-target@1.35.0 - @segment/analytics-browser-actions-algolia-plugins@1.12.0 - @segment/analytics-browser-actions-amplitude-plugins@1.35.0 - @segment/analytics-browser-actions-braze-cloud-plugins@1.38.0 - @segment/analytics-browser-actions-braze@1.38.0 - @segment/analytics-browser-actions-bucket@1.15.0 - @segment/analytics-browser-actions-cdpresolution@1.22.0 - @segment/analytics-browser-actions-commandbar@1.35.0 - @segment/analytics-browser-actions-devrev@1.22.0 - @segment/analytics-browser-actions-friendbuy@1.35.0 - @segment/analytics-browser-actions-fullstory@1.37.0 - @segment/analytics-browser-actions-google-analytics-4@1.41.0 - @segment/analytics-browser-actions-google-campaign-manager@1.25.0 - @segment/analytics-browser-actions-heap@1.35.0 - @segment/analytics-browser-hubble-web@1.21.0 - @segment/analytics-browser-actions-hubspot@1.35.0 - @segment/analytics-browser-actions-intercom@1.36.0 - @segment/analytics-browser-actions-iterate@1.35.0 - @segment/analytics-browser-actions-jimo@1.23.0 - @segment/analytics-browser-actions-koala@1.35.0 - @segment/analytics-browser-actions-logrocket@1.35.0 - @segment/analytics-browser-actions-pendo-web-actions@1.24.0 - @segment/analytics-browser-actions-playerzero@1.35.0 - @segment/analytics-browser-actions-replaybird@1.16.0 - @segment/analytics-browser-actions-ripe@1.35.0 - @segment/analytics-browser-actions-rupt@1.24.0 - @segment/analytics-browser-actions-screeb@1.35.0 - @segment/analytics-browser-actions-utils@1.35.0 - @segment/analytics-browser-actions-snap-plugins@1.16.0 - @segment/analytics-browser-actions-sprig@1.35.0 - @segment/analytics-browser-actions-stackadapt@1.35.0 - @segment/analytics-browser-actions-survicate@1.11.0 - @segment/analytics-browser-actions-tiktok-pixel@1.32.0 - @segment/analytics-browser-actions-upollo@1.35.0 - @segment/analytics-browser-actions-userpilot@1.35.0 - @segment/analytics-browser-actions-vwo@1.36.0 - @segment/analytics-browser-actions-wiseops@1.35.0 commit b124efd Author: Joe Ayoub <joe.ayoub@segment.com> Date: Fri Apr 5 11:06:23 2024 +0100 minor commit to check publish commit 79cdd99 Author: Joe Ayoub <45374896+joe-ayoub-segment@users.noreply.github.com> Date: Fri Apr 5 11:01:30 2024 +0100 Publish from release branch (#1973) * minor update to an Action Destination * updating publish to allow from release branch * updating * Publish - @segment/action-destinations@3.256.0 commit 6e021c2 Author: Varadarajan V <109586712+varadarajan-tw@users.noreply.github.com> Date: Thu Apr 4 20:24:08 2024 +0530 [STRATCONN-3673] - Minor fixes to github scripts and adds test instructions (#1970) * Some cosmetic fixes to release workflow * Add testing instructions * Update TESTING.md * Add comments to improve readability of the script * add comments
This PR makes some minor fixes to
create-github-release
andcompute-labels
workflow.create-github-release
scriptTesting
Testing completed successfully in local
Compute Labels
Release script