Skip to content

feat: adds GitHub action to update notion #1

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 10 commits into from
Dec 8, 2021

Conversation

techpool
Copy link
Member

@techpool techpool commented Dec 3, 2021

Changes:

  • Adds a github action for updating notion tasks

@techpool
Copy link
Member Author

techpool commented Dec 3, 2021

Apologies for the huge change, but there is no other way to do it. The node_modules has to be there in the repository.

Example GitHub Action:
https://github.com/github/codeql-action

@shentao
Copy link
Member

shentao commented Dec 5, 2021

Hey @techpool! Would it be possible to do an interactive rebase and have the node_modules be in a separate commit? This way we could review all the other changes rather easily and skip the node_modules.

@techpool techpool force-pushed the update-notion-github-action branch from a2261c3 to 78d4e23 Compare December 6, 2021 07:04
@techpool
Copy link
Member Author

techpool commented Dec 6, 2021

@shentao I cleaned up the commit history to be a bit clean and have a separate commit for node modules. Hope this helps!

@techpool techpool force-pushed the update-notion-github-action branch from a5d73ef to 27a7577 Compare December 6, 2021 10:03
@kubakrzempek
Copy link
Member

Frankly, it's still difficult to review this even if there is one commit with node modules. Can we create PR to this PR with the node modules to leave only "meaningful" changes here, please?

Also, maybe I don't get how GHA works internally, but what prevents us from checking out the code and running npm ci there to install the node modules?

@techpool
Copy link
Member Author

techpool commented Dec 7, 2021

Can do that as well. We'll anyway have to checkout to this repository in other repositories.

@techpool
Copy link
Member Author

techpool commented Dec 7, 2021

Probably just has to be tried out to be sure it works that way. But technically that does make sense and also possible.

@techpool
Copy link
Member Author

techpool commented Dec 7, 2021

@kubakrzempek have pushed in only relevant changes with no node_modules. Technically this should still be possible by installing node_modules before using it.

Copy link
Member

@kubakrzempek kubakrzempek left a comment

Choose a reason for hiding this comment

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

Lovely :)

@@ -0,0 +1,126 @@
# Logs
Copy link
Member

Choose a reason for hiding this comment

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

Lot's of defaults there. :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah just copied the default node.js .gitignore. 😅 . Shall I revert it back to a trimmed down minimal gitignore?

} else if (commitMessage.match(/#+[0-9]/)) {
// direct from open PR to staging
const prNumber = commitMessage.split('#')[1].replace(/\D/g, '')
notionUtil.updateByPR(`${repositoryName}/pull/${prNumber}`, 'Completed (Production)')
Copy link
Member

Choose a reason for hiding this comment

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

Is this possible to have a regex or wildcard here? What if someone posted PR link with /files (e.g. https://github.com/coursedog/notion-scripts/pull/1/files)? I see it from time to time on notion and I think in that case the integration won't work

utils/notion.js Outdated
{
property: this.labels.GITHUB_PR,
text: {
ends_with: pr,
Copy link
Member

Choose a reason for hiding this comment

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

... continue on my previous comment, starts_with:? If it's available?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated it to starts_with property. And it is available as a filter:

https://developers.notion.com/reference/post-database-query#text-filter-condition

@techpool techpool requested a review from kubakrzempek December 7, 2021 12:28
@techpool techpool merged commit c87d6df into main Dec 8, 2021
@techpool techpool deleted the update-notion-github-action branch December 8, 2021 13:07
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.

3 participants