Skip to content

Commit b797fef

Browse files
authored
chore: add branding labels and readme (#11)
1 parent 4b4167c commit b797fef

File tree

2 files changed

+30
-102
lines changed

2 files changed

+30
-102
lines changed

README.md

Lines changed: 27 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,41 @@
1-
# Create a JavaScript Action
1+
# "Update Notion Page" Action for GitHub Actions
22

3-
<p align="center">
4-
<a href="https://github.com/actions/javascript-action/actions"><img alt="javscript-action status" src="https://github.com/actions/javascript-action/workflows/units-test/badge.svg"></a>
5-
</p>
3+
**Table of Contents**
64

7-
Use this template to bootstrap the creation of a JavaScript action.:rocket:
5+
<!-- toc -->
86

9-
This template includes tests, linting, a validation workflow, publishing, and versioning guidance.
7+
- [Usage](#usage)
8+
- [License Summary](#license-summary)
109

11-
If you are new, there's also a simpler introduction. See the [Hello World JavaScript Action](https://github.com/actions/hello-world-javascript-action)
10+
<!-- tocstop -->
1211

13-
## Create an action from this template
14-
15-
Click the `Use this Template` and provide the new repo details for your action
16-
17-
## Code in Main
18-
19-
Install the dependencies
20-
21-
```bash
22-
npm install
23-
```
24-
25-
Run the tests :heavy_check_mark:
26-
27-
```bash
28-
$ npm test
29-
30-
PASS ./index.test.js
31-
✓ throws invalid number (3ms)
32-
wait 500 ms (504ms)
33-
test runs (95ms)
34-
...
35-
```
36-
37-
## Change action.yml
38-
39-
The action.yml defines the inputs and output for your action.
40-
41-
Update the action.yml with your name, description, inputs and outputs for your action.
42-
43-
See the [documentation](https://help.github.com/en/articles/metadata-syntax-for-github-actions)
44-
45-
## Change the Code
46-
47-
Most toolkit and CI/CD operations involve async operations so the action is run in an async function.
48-
49-
```javascript
50-
const core = require('@actions/core');
51-
...
52-
53-
async function run() {
54-
try {
55-
...
56-
}
57-
catch (error) {
58-
core.setFailed(error.message);
59-
}
60-
}
61-
62-
run()
63-
```
64-
65-
See the [toolkit documentation](https://github.com/actions/toolkit/blob/master/README.md#packages) for the various packages.
66-
67-
## Package for distribution
68-
69-
GitHub Actions will run the entry point from the action.yml. Packaging assembles the code into one file that can be checked in to Git, enabling fast and reliable execution and preventing the need to check in node_modules.
70-
71-
Actions are run from GitHub repos. Packaging the action will create a packaged action in the dist folder.
72-
73-
Run prepare
74-
75-
```bash
76-
npm run prepare
77-
```
12+
## Usage
7813

79-
Since the packaged index.js is run from the dist folder.
14+
Add the following step to your workflow:
8015

81-
```bash
82-
git add dist
16+
```yaml
17+
- name: Update Notion Page
18+
uses: ydataai/update-notion-page@v1
19+
with:
20+
notion_secret: "<NOTION_SECRET_TOKEN>"
21+
notion_page_id: "<NOTION_PAGE_ID>"
22+
notion_page_update_properties: '{ "In stock": { "checkbox": false } }'
8323
```
8424
85-
## Create a release branch
86-
87-
Users shouldn't consume the action from master since that would be latest code and actions can break compatibility between major versions.
88-
89-
Checkin to the v1 release branch
25+
Or fi you want to use a page of a database without the direct `page_id`:
9026

91-
```bash
92-
git checkout -b v1
93-
git commit -a -m "v1 release"
94-
```
95-
96-
```bash
97-
git push origin v1
27+
```yaml
28+
- name: Update Notion Page
29+
uses: ydataai/update-notion-page@v1
30+
with:
31+
notion_secret: "<NOTION_SECRET_TOKEN>"
32+
notion_database_id: "<NOTION_DATABASE_ID>"
33+
notion_database_query_filter: '{ "property": "In stock", "checkbox": { "equals": true } }'
34+
notion_page_update_properties: '{ "In stock": { "checkbox": false } }'
9835
```
9936

100-
Note: We recommend using the `--license` option for ncc, which will create a license file for all of the production node modules used in your project.
101-
102-
Your action is now published! :rocket:
103-
104-
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
37+
See [action.yml](action.yml) for the full documentation for this action's inputs and outputs.
10538

106-
## Usage
107-
108-
You can now consume the action by referencing the v1 branch
109-
110-
```yaml
111-
uses: actions/javascript-action@v1
112-
with:
113-
milliseconds: 1000
114-
```
39+
## License
11540

116-
See the [actions tab](https://github.com/actions/javascript-action/actions) for runs of this action! :rocket:
41+
The scripts and documentation in this project are released under the MIT License

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: '"Update Notion Page" Action for GitHub Actions'
22
description: 'GitHub Action to update an existing notion page'
33
author: "ydataai"
4+
branding:
5+
icon: 'arrow-up-right'
6+
color: 'white'
47
inputs:
58
notion_secret:
69
description: 'Notion secret token'

0 commit comments

Comments
 (0)