-
Notifications
You must be signed in to change notification settings - Fork 0
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
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d01c36d
feat: initial commit with github action to update notion tasks
techpool 78d4e23
chore: adds node modules
techpool ce06d8a
fix: adds test workflow
techpool 0fcdb8f
chore: adds octokit rest package
techpool 27a7577
fix: adds support for main branch
techpool ac8c8c2
fix: changes trigger events for notion update
techpool e035b0a
chore: minor improvements in code
techpool a275c08
fix: removed node_modules from repository
techpool 71e5f0f
ci: adds npm ci step to the workflow step for installing node modules
techpool ad4e12e
refactor: updates ends_with property with starts_with property
techpool 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,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
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,77 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
commonjs: true, | ||
es2021: true, | ||
}, | ||
extends: 'eslint:recommended', | ||
parserOptions: { | ||
ecmaVersion: 13, | ||
}, | ||
globals: { | ||
process: 'readonly', | ||
}, | ||
rules: { | ||
'no-extend-native': [ 'error', { exceptions: [ 'Array' ] } ], | ||
'no-global-assign': [ 'error', { exceptions: [ 'self' ] } ], | ||
'generator-star-spacing': 'off', | ||
// eslint-disable-next-line no-undef | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', | ||
'no-trailing-spaces': [ 'error', { skipBlankLines: true } ], | ||
'array-bracket-spacing': [ 'error', 'always' ], | ||
'arrow-body-style': [ 'warn', 'as-needed' ], | ||
'standard/no-callback-literal': 0, | ||
'comma-dangle': [ | ||
'warn', | ||
{ | ||
arrays: 'always-multiline', | ||
objects: 'always-multiline', | ||
imports: 'never', | ||
exports: 'never', | ||
functions: 'ignore', | ||
}, | ||
], | ||
'curly': [ 'warn', 'multi-line' ], | ||
'eol-last': [ 'error', 'always' ], | ||
'indent': [ 'error', 2, { SwitchCase: 1, VariableDeclarator: 1 } ], | ||
'max-len': [ | ||
'warn', | ||
{ | ||
code: 140, | ||
ignoreComments: true, | ||
ignoreTrailingComments: true, | ||
ignoreStrings: true, | ||
ignorePattern: '.+=".+"', | ||
}, | ||
], | ||
'no-multiple-empty-lines': [ 'error', { max: 1, maxEOF: 1 } ], | ||
'no-prototype-builtins': 0, | ||
'object-curly-spacing': [ 'error', 'always' ], | ||
'object-property-newline': [ 'error', { allowAllPropertiesOnSameLine: true } ], | ||
'padded-blocks': 'off', | ||
'prefer-const': [ 'error', { destructuring : 'all' } ], | ||
'prefer-template': 'error', | ||
'quote-props': [ 'error', 'consistent-as-needed' ], | ||
'quotes': [ | ||
'error', | ||
'single', | ||
{ | ||
avoidEscape: true, | ||
// TODO: Remove this rule and autofix, | ||
// as we don't need useless template literals | ||
allowTemplateLiterals: true, | ||
}, | ||
], | ||
'semi': [ 'error', 'never', { beforeStatementContinuationChars: 'never' } ], | ||
'space-before-function-paren': [ 'warn', 'always' ], | ||
'spaced-comment': [ | ||
'error', | ||
'always', | ||
{ | ||
block: { | ||
markers: [ '!' ], | ||
}, | ||
}, | ||
], | ||
}, | ||
} |
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,54 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
name: Lint | ||
|
||
# Controls when the action will run. Triggers the workflow on push or pull request | ||
# events but on dev and staging branches | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- 'feature/**' | ||
- 'features/**' | ||
push: | ||
branches: | ||
- main | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
prepare: | ||
name: Prepare & Cleanup Previous Runs | ||
if: always() | ||
runs-on: ubuntu-latest | ||
outputs: | ||
commit_message: ${{ steps.get_message.outputs.commit_message }} | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: rokroskar/[email protected] | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
- id: get_message | ||
name: Set Commit Message | ||
run: echo ::set-output name=commit_message::$(git log --format=%B -n 1 ${{ github.event.after }}) | ||
- name: Show Commit Message | ||
run: echo "${{ steps.get_message.outputs.commit_message }}" | ||
|
||
lint-and-units: | ||
name: ESLint | ||
needs: prepare | ||
timeout-minutes: 45 | ||
if: (github.event.pull_request.draft == false) && !startsWith(github.head_ref, 'tech') && !startsWith(github.head_ref, 'doc') && !contains(needs.prepare.outputs.commit_message, '[skip ci]') | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- name: Show Commit Message | ||
run: echo "${{ needs.prepare.outputs.commit_message }}" | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '16.x' | ||
- name: Run ESLint | ||
if: always() | ||
run: npm run lint |
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,31 @@ | ||
name: Update Notion Statuses | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
- staging | ||
|
||
jobs: | ||
notion_update_job: | ||
runs-on: ubuntu-latest | ||
name: Update Notion Task | ||
steps: | ||
# To use this repository's private action, | ||
# you must check out the repository | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '16.x' | ||
- run: npm ci | ||
|
||
- name: Update Notion Task | ||
uses: ./update_notion # Uses an action in the root directory | ||
id: update_notion | ||
with: | ||
NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }} | ||
NOTION_DATABASE_TOKEN: ${{ secrets.NOTION_DATABASE_TOKEN }} |
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,126 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
.pnpm-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Snowpack dependency directory (https://snowpack.dev/) | ||
web_modules/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional stylelint cache | ||
.stylelintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.env.local | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
.parcel-cache | ||
|
||
# Next.js build output | ||
.next | ||
out | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
# Comment in the public line in if your project uses Gatsby and not Next.js | ||
# https://nextjs.org/blog/next-9-1#public-directory-support | ||
# public | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# vuepress v2.x temp and cache directory | ||
.temp | ||
.cache | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# Stores VSCode versions used for testing VSCode extensions | ||
.vscode-test | ||
|
||
# yarn v2 | ||
.yarn/cache | ||
.yarn/unplugged | ||
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* |
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.
Lot's of defaults there. :)
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.
Yeah just copied the default node.js .gitignore. 😅 . Shall I revert it back to a trimmed down minimal gitignore?