-
Notifications
You must be signed in to change notification settings - Fork 346
Update README.md #472
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
base: main
Are you sure you want to change the base?
Update README.md #472
Conversation
|
5665e3f to
1a6037c
Compare
- updates actions to latest versions - updates node version to lts
|
I restructured the readme a bit. I changed the inputs and outputs section to use tables instead, can revert if that's not desirable. Added an advanced section as well, after examples, with Full preview here https://github.com/h3rmanj/changesets-action/blob/docs/workflow-permissions/README.md |
Probably worthwhile adding a bit about its limitations, namely that it won't commit symlinks, executable files or submodules (as this isn't supported by the API). We should probably add a section to the changesets/ghcommit README too, and link to that from this README |
| ### Triggering other workflows | ||
|
|
||
| When using the built-in `GITHUB_TOKEN`, tags, releases and pull requests created by this action won't trigger other workflows. From the [GitHub Docs docs](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#triggering-a-workflow-from-a-workflow): | ||
|
|
||
| > When you use the repository's `GITHUB_TOKEN` to perform tasks, events triggered by the `GITHUB_TOKEN`, will not create a new workflow run. This prevents you from accidentally creating recursive workflow runs. | ||
|
|
||
| To fix this, you should use a [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) or a [GitHub App token](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow) for this action. You also need to set the `commitMode` input to `github-api`. | ||
|
|
||
| This is useful when using this action for [managing applications or non-npm packages](https://github.com/changesets/changesets/blob/main/docs/versioning-apps.md), and using tag or release triggers for custom release workflows. |
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.
Hm, IIRC some of the restrictions are lifted when using PAT - even with the default commitMode. Do you know what's the breakdown of what becomes possible with PAT using both modes?
Full breakdown from some testing
| Variation | push.branches |
push.tags |
pull_request.opened |
pull_request.synchronized |
release.published |
|---|---|---|---|---|---|
| Built-in token | ❌ | ❌ | ❌ | ❌ | ❌ |
| PAT | ❌ | ❌ | ✅ | ❌ | ✅ |
PAT + github-api |
✅ | ✅ | ✅ | ❌ re-triggers opened instead |
✅ |
PAT + actions/checkout PAT |
✅ | ✅ | ✅ | ✅ | ✅ |
Not sure if I should document all these possible variations though. Personally I prefer github-api mode for the following reasons:
- Commit signing
- It's built-in to the action itself, so you can achieve desired result by only configuring this action
- Once configured, it enables all event triggers, not just some
@Andarist what would you like see mentioned in the readme?
|
@h3rmanj the https://github.com/changesets/ghcommit README has a section on known limitations now if you want to link to that? |
|
|
||
| ### Triggering other workflows | ||
|
|
||
| When using the built-in `GITHUB_TOKEN`, tags, releases and pull requests created by this action won't trigger other workflows. From the [GitHub Docs docs](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#triggering-a-workflow-from-a-workflow): |
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 think the docs is a duplicate and it should only be one:
| When using the built-in `GITHUB_TOKEN`, tags, releases and pull requests created by this action won't trigger other workflows. From the [GitHub Docs docs](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#triggering-a-workflow-from-a-workflow): | |
| When using the built-in `GITHUB_TOKEN`, tags, releases and pull requests created by this action won't trigger other workflows. From the [GitHub Docs](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#triggering-a-workflow-from-a-workflow): |
Adds information about required permission and how to trigger other workflows using this action. Tested what's working and not in https://github.com/h3rmanj/changesets-triggers.
The feature that actually makes this possible is the
commitMode: github-apiintroduced in #391. This just documents that it's possible.Closes #1545, closes #187, closes #70, closes #220
It probably also closes other issues that's caused by this as well.