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

ci: add changeset automation #1653

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Shurtu-gal
Copy link
Collaborator

Description

Related issue(s)
See also #1652

@Shurtu-gal Shurtu-gal added the area/ci-cd Specify what technical area given issue relates to. Its goal is to ease filtering good first issues. label Feb 8, 2025
@Shurtu-gal Shurtu-gal self-assigned this Feb 8, 2025
Copy link

changeset-bot bot commented Feb 8, 2025

⚠️ No Changeset found

Latest commit: 11f4905

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Shurtu-gal
Copy link
Collaborator Author

Pinging @derberg as this is related to CI/CD as well.


on:
pull_request_target:
types:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should probably trigger it on all events types: [opened, reopened, synchronize, edited, ready_for_review]

git commit -m "chore: add changeset for PR #${{ github.event.pull_request.number }}"

- name: Push changeset file
run: git push https://${{ secrets.GH_TOKEN }}@github.com/${{ github.event.pull_request.head.repo.full_name }} HEAD:${{ github.event.pull_request.head.ref }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check with chatgpt but I think for security reasons better not pash secrets this way - maybe they annonymize secrets in logs, but yeah if better to be secure and add one more line to configure token with git remove - I think we should do it

run: git push https://${{ secrets.GH_TOKEN }}@github.com/${{ github.event.pull_request.head.repo.full_name }} HEAD:${{ github.event.pull_request.head.ref }}

# Only, on failure, send a message on the 94_bot-failing-ci slack channel
- if: failure()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case to workflows running on PR I don't think we need to drop errors to slack - this is going to be visible in the CI status at the bottom of PR

}

- name: Create changeset file
run: "echo -e '---\n'@asyncapi/cli': ${{ steps.determine_release_type.outputs.result }}\n---\n\n ${{ github.event.pull_request.title }}\n' > .changeset/${{ github.event.pull_request.number }}.md"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you sure you wanna hardcode this way? to cli, knowing there will be more projects in repo in future?

maybe try changeset cli with --empty flag - as I hope it works this way that it will smartly determine all project names

I strongly suggest, such a generated changeset has a large multiline comment with info that it is generated and should be manually reviewed. Cause is the end, I don't know if without human we are able to make a decision what package should be released 🤔

also we probably should drop some comment in the PR, that both created Changeset and that it must be reviewed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly --empty just creates a empty changeset file. And others require interactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci-cd Specify what technical area given issue relates to. Its goal is to ease filtering good first issues.
Projects
Status: To Triage
Development

Successfully merging this pull request may close these issues.

3 participants