-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Ashish Padhy <[email protected]>
Signed-off-by: Ashish Padhy <[email protected]>
|
Pinging @derberg as this is related to CI/CD as well. |
|
||
on: | ||
pull_request_target: | ||
types: |
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.
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 }} |
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.
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() |
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.
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" |
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.
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
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.
Sadly --empty
just creates a empty changeset file. And others require interactivity.
|
Description
Related issue(s)
See also #1652