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

chore(ci): Update pull request workflow to include error message on wrong conventional title #526

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kevaundray
Copy link
Contributor

Description

Please provide a paragraph or two giving a summary of the change, including relevant motivation and context.

Checklist:

  • I have reviewed my diff in github, line by line.
  • Every change is related to the PR description.
  • I have linked this pull request to the issue(s) that it resolves.
  • There are no unexpected formatting changes, superfluous debug logs, or commented-out code.
  • There are no circuit changes, OR specifications in /markdown/specs have been updated.
  • There are no circuit changes, OR a cryptographer has been assigned for review.
  • I've updated any terraform that needs updating (e.g. environment variables) for deployment.
  • The branch has been rebased against the head of its merge target.
  • I'm happy for the PR to be merged at the reviewer's next convenience.
  • New functions, classes, etc. have been documented according to the doxygen comment format. Classes and structs must have @brief describing the intended functionality.
  • If existing code has been modified, such documentation has been added or updated.

@kevaundray kevaundray changed the title chore(ci): update pull request workflow update pull request workflow Jun 13, 2023
@kevaundray
Copy link
Contributor Author

the default github token/action settings does not have write permissions, hence the error. This PR makes the dev-ux better but it not 100% necessary

@kevaundray kevaundray changed the title update pull request workflow update pull request workflow to include error message on wrong conventional title Jun 13, 2023
Comment on lines +31 to +50
- uses: marocchino/sticky-pull-request-comment@v2
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: |
Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.

Details:

```
${{ steps.lint_pr_title.outputs.error_message }}
```

- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true
Copy link
Contributor

Choose a reason for hiding this comment

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

If you are trying to create a comment, it needs write permissions, and if you are giving write permissions to a workflow, it can't run on pull_request because someone could exfiltrate the token. You need to use pull_request_target with any write permissions.

@kevaundray kevaundray changed the title update pull request workflow to include error message on wrong conventional title chore(ci): Update pull request workflow to include error message on wrong conventional title Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants