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

fix(ci): fixes typos and small issues on github scripts #1302

Merged

Conversation

rubenfonseca
Copy link
Contributor

@rubenfonseca rubenfonseca commented Jul 15, 2022

Issue number: #1009

Summary

Changes

Please provide a summary of what's being changed

This PR contains a bunch of small improvements to Github scripts:

  1. Fixes a typo on the script that auto-labels based on area (currently broken)
  2. Removes unnecessary escaping on regex
  3. Removes dangerous return statement inside finally block
  4. Removes unused variables
  5. Fixes potential crash due to use of unknown variables

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jul 15, 2022
@rubenfonseca rubenfonseca requested a review from heitorlessa July 15, 2022 09:34
@github-actions github-actions bot added the bug Something isn't working label Jul 15, 2022
@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 15, 2022
@rubenfonseca rubenfonseca changed the title fix(ci): typo on variable name fix(ci): fixes typos and small issues on github scripts Jul 15, 2022
Copy link
Contributor

@heitorlessa heitorlessa left a comment

Choose a reason for hiding this comment

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

thanks a lot for these changes! only have comments so will merge as it's a blocking one and I can learn more about the no-return idea later

@@ -54,7 +54,7 @@ module.exports = async ({github, context, core}) => {
}
} finally {
if (miss == Object.keys(labels).length) {
return core.notice(`PR ${PR_NUMBER} title '${PR_TITLE}' doesn't follow semantic titles; skipping...`)
Copy link
Contributor

Choose a reason for hiding this comment

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

for my own benefit, why not a return?

Comment on lines +34 to +37
} catch (error) {
core.setFailed(`Unable to create comment on PR number ${PR_NUMBER}.\n\n Error details: ${error}`);
throw new Error(error);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

YES!!! thank you

core.info(`Auto-labeling related issue ${issue} for release`)
return await github.rest.issues.addLabels({
Copy link
Contributor

Choose a reason for hiding this comment

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

for my own benefit, why not a return?

@heitorlessa heitorlessa added the github-actions Pull requests that update Github_actions code label Jul 18, 2022
@heitorlessa heitorlessa merged commit c912034 into aws-powertools:develop Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working github-actions Pull requests that update Github_actions code size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants