-
Notifications
You must be signed in to change notification settings - Fork 360
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
Add an automated zip workflow #6862
Conversation
Very cool work and great POC, I think this definitely is a promising step in the right direction! I tested this out and both adding a new theme and updating an existing one appears to be working well. I ran into a couple issues when trying to post an update via a comment:
More generally, I think there are a few issues we should solve before this PR will be useful: WordPress/create-block-theme#174 |
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.
Great work! It's a nice step to automate the theme launch process. 🎆
I tested this with few scenarios and left minor feedback inline.
with: | ||
destination_branch: "trunk" | ||
source_branch: "${{ env.BRANCH_NAME }}" | ||
pr_title: "Automated Theme Change: [${{ env.THEME_NAME }}]" |
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.
For title, I think its good avoid automation keyword. I suggest something like Add new theme: THEME_NAME
pr_title: "Automated Theme Change: [${{ env.THEME_NAME }}]" | |
pr_title: "Add new theme: ${{ env.THEME_NAME }}" |
|
||
Closes: #${{ github.event.issue.number }} | ||
|
||
_ |
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 add pr_reviewer
(Theam) and pr_assignee
(self) ?
echo "ZIP_URL=${{ steps.match-url.outputs.group1 }}" >> $GITHUB_ENV | ||
echo "ZIP_FILENAME=${{ steps.match-filename.outputs.group1 }}" >> $GITHUB_ENV | ||
echo "THEME_NAME=${{ steps.match-theme-name.outputs.group1 }}" >> $GITHUB_ENV | ||
echo "BRANCH_NAME=auto/${{ steps.match-theme-name.outputs.group1 }}" >> $GITHUB_ENV |
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.
since the branch name
is derived from the zip name
,
when zip name changes on edit ex: theme-name to theme-name(1)
,
it creates a fresh branch and a new PR instead of updating existing one.
Also, it fails to create PR for zip name with spaces.
id: match-theme-name | ||
with: | ||
text: ${{ github.event.issue.body }} | ||
regex: '\(.*\/(.*?)\.zip\)' |
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.
it will be nice to iterate later to bring THEME_NAME from style.css
instead of zip name. (if there is no such name it can fallback to zip name)
id: match-url | ||
with: | ||
text: ${{ github.event.issue.body }} | ||
regex: '\((.*?\.zip)\)' |
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.
The action triggers for any new issue created and creates PRs if it has a Zip attached.
Trigger the action on issues that are having a special label. like New Theme
may be.
- name: Extract Zip URL (comment) | ||
uses: actions-ecosystem/action-regex-match@v2 | ||
if: ${{ github.event.comment.body }} | ||
id: match-url-comment | ||
with: | ||
text: ${{ github.event.comment.body }} | ||
regex: '\((.*?\.zip)\)' | ||
|
||
- name: Extract Zip Filename (comment) | ||
uses: actions-ecosystem/action-regex-match@v2 | ||
if: ${{ github.event.comment.body }} | ||
id: match-filename-comment | ||
with: | ||
text: ${{ github.event.comment.body }} | ||
regex: '\(.*\/(.*?\.zip)\)' | ||
|
||
- name: Extract Theme Name (comment) | ||
uses: actions-ecosystem/action-regex-match@v2 | ||
if: ${{ github.event.comment.body }} | ||
id: match-theme-name-comment | ||
with: | ||
text: ${{ github.event.comment.body }} | ||
regex: '\(.*\/(.*?)\.zip\)' |
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.
It triggers for any comment made on any issue. It should also be restricted only to issues that have special label.
I think that this is probably more moving parts than is helpful, coupled with a workflow that is cumbersome. Closing this idea now while pursuing git integration instead. |
Changes proposed in this Pull Request:
This action will automatically open a PR when a .zip file is attached to an issue BODY or COMMENT.
(NOTE: I think that this will need to be MERGED before it will actually run which makes it kinda hard to test... You can see [many] test runs here to see what this change is supposed to accomplish).
This action allows for the following workflow:
banana.zip
.auto/banana
).This closes #6850