-
Notifications
You must be signed in to change notification settings - Fork 6
Add Assign Milestone Workflow #41
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c6d3a45
Add test workflow
mikejolley e8078cd
Add assign-milestone automation
mikejolley 9a2c202
tests
mikejolley 94df0df
tests
mikejolley 650f48a
missing checkout
mikejolley f3f4dee
build
mikejolley b5a3c6e
testing
mikejolley 8dc61b2
build
mikejolley 71587aa
testing
mikejolley 0566340
build
mikejolley 8738f60
debug
mikejolley b62b9dd
build
mikejolley 2ac781b
Use correct data
mikejolley b497621
Fix tests
mikejolley bdca4f4
readme
mikejolley f226d2b
Prettier and formatting
mikejolley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| on: pull_request_review | ||
| name: Add milestone when approved | ||
| jobs: | ||
| milestoneWhenApproved: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: ./ | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| automations: assign-milestone |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| // Import the default config file and expose it in the project root. | ||
| // Useful for editor integrations. | ||
| module.exports = require( '@wordpress/prettier-config' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| ## Assign Milestone Automation | ||
|
|
||
| When a pull request is approved and is not already assigned a milestone, this automation will assign the next milestone to it | ||
| automatically. | ||
|
|
||
| ## Usage | ||
|
|
||
| To implement this action, include it in your workflow configuration file: | ||
|
|
||
| ```yaml | ||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, closed] | ||
| push: | ||
| issues: | ||
| types: [edited] | ||
| jobs: | ||
| pull-request-automation: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: woocommerce/automations@v1 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| # This can be a comma delimited list of automations to run, in this case we're just executing assign-milestone | ||
| automations: assign-milestone | ||
| ``` | ||
|
|
||
| ## API | ||
|
|
||
| ### Inputs | ||
|
|
||
| - `github_token`: Required. GitHub API token to use for making API requests. You can use the default `secrets.GITHUB_TOKEN` used by GitHub actions or store a different one in the secrets configuration of your GitHub repository. | ||
| - `automations`: Optional. You can include a comma-delimited list of specific automations you want to run if you don't want to use them all in a given workflow. | ||
|
|
||
| ### Outputs | ||
|
|
||
| _None._ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| const runner = require( './runner' ); | ||
|
|
||
| module.exports = { | ||
| name: 'assign-milestone', | ||
| events: [ 'pull_request_review' ], | ||
| actions: [ 'submitted', 'edited' ], | ||
| runner, | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 wonder if we should release a
@v2as a result of implementing the new automation (that way if there are unintended issues with existing automations folks can rollback)?This can be done in a followup if we end up doing that.
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.
Yup I'm fine with that. This shouldn't affect existing workflows because you'd need to call assign-milestone by name in your workflow file?
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.
Oh true, I guess there's not any changes to existing tasks (or shared code across tasks) so it's safe to release under the existing version. We could probably reserve version bumps for when there's potentially task breaking changes.
Are you okay with doing a release or want me to take care of it? If you take care of it, this repo uses the release PR automation (similar to process we follow for blocks repo) except the checklist is much smaller. It's currently mostly manual as it's mostly just creating the correct tags etc. The release PR checklist should have all the steps needed.