Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6684bea

Browse filesBrowse files
committed
Update README
* Bump version to v1.0.0 * Add description about strict mode * Add strict option for workflow YAML and .env
1 parent c073195 commit 6684bea
Copy full SHA for 6684bea

File tree

Expand file treeCollapse file tree

2 files changed

+28
-8
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+28
-8
lines changed

‎README/en.md

Copy file name to clipboardExpand all lines: README/en.md
+17-7Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ jobs:
6161
runs-on: ubuntu-latest
6262
steps:
6363
- name: "Publish to Qiita"
64-
uses: noraworld/github-to-qiita@v0.2.0
64+
uses: noraworld/github-to-qiita@v1.0.0
6565
with:
6666
dir: "articles"
6767
qiita_access_token: ${{ secrets.QIITA_ACCESS_TOKEN }}
68+
mapping_filepath: "mapping.txt"
69+
strict: false
6870
```
6971
7072
Replace a part of the above YAML code with the following.
@@ -74,11 +76,17 @@ Replace a part of the above YAML code with the following.
7476
| `jobs.qiita.steps[*].with.dir` | Specify a directory in which files you want to track and publish to Qiita | true | `articles` |
7577
| `jobs.qiita.steps[*].with.qiita_access_token` | Specify your Qiita access token (accessible by `${{ secrets.QIITA_ACCESS_TOKEN }}` [^1]) | true | `${{ secrets.QIITA_ACCESS_TOKEN }}` |
7678
| `jobs.qiita.steps[*].with.mapping_filepath` | Specify any file path in which you want to put the mapping file | false | `mapping.txt` |
79+
| `jobs.qiita.steps[*].with.strict` | Specify whether the strict mode is on or off | false | `false` |
7780

7881
[^1]: Only in case you set the secret environment variable name as `QIITA_ACCESS_TOKEN` at the previous step.
7982

8083
**WARNING:** Please do not set the version to `@main` at the `jobs.qiita.steps[*].uses` section for a production use because the specification is subject to change, and the latest codes potentially contain bugs. It is highly recommended to set the latest tagged version, which can be accessible at the [Tags page](/../../tags).
8184

85+
#### About the strict mode
86+
The strict mode determines whether your article will be published newly or not even if the corresponding article on Qiita is not found and your article file on your repository is MODIFIED (not ADDED). When the strict mode is on (`jobs.qiita.steps[*].with.strict` is set to `true`), your article won’t be published newly if the mapping file is incomplete, the corresponding article on Qiita is not found, and your article file is MODIFIED. Otherwise, your article will be published newly.
87+
88+
If your mapping information is not fully filled, it is recommended to set `true` because if `false` your article can be going to be published newly even if your articles exist on Qiita. But note that if your new article failed to publish to Qiita for some reason (The Qiita API is down or your article is invalid), your article will never be published as long as you don’t publish manually. Consider setting `jobs.qiita.steps[*].with.strict` to `false` to avoid it.
89+
8290
---
8391

8492
That’s all!
@@ -148,14 +156,16 @@ ADDED_FILES="articles/test01.md"
148156
MODIFIED_FILES="articles/test02.md"
149157
MAPPING_FILEPATH="mapping.txt"
150158
QIITA_ACCESS_TOKEN="7f6c7aec310ded84ae3acfe8f920cb1c7556c7d3" # THIS IS A SAMPLE!!
159+
STRICT="true"
151160
```
152161

153-
| Environment Variable Name | Description | Required |
154-
| ------------------------- | ---------------------------------------------------------- | -------- |
155-
| `ADDED_FILES` | Paths of articles that will be published newly | false |
156-
| `MODIFIED_FILES` | Paths of articles that will be modified | false |
157-
| `MAPPING_FILEPATH` | A filepath to which file it writes the mapping information | true |
158-
| `QIITA_ACCESS_TOKEN` | Your Qiita access token (for development) | true |
162+
| Environment Variable Name | Description | Required |
163+
| ------------------------- | ------------------------------------------------------------------------------------------ | -------- |
164+
| `ADDED_FILES` | Paths of articles that will be published newly | false |
165+
| `MODIFIED_FILES` | Paths of articles that will be modified | false |
166+
| `MAPPING_FILEPATH` | A filepath to which file it writes the mapping information | true |
167+
| `QIITA_ACCESS_TOKEN` | Your Qiita access token (for development) | true |
168+
| `STRICT` | Whether the strict mode is on or off (See [About the strict mode](#about-the-strict-mode)) | true |
159169

160170
**NOTE:** It is highly recommended to use the Qiita access token that is different from one for a production use.
161171

‎README/ja.md

Copy file name to clipboardExpand all lines: README/ja.md
+11-1Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ jobs:
6161
runs-on: ubuntu-latest
6262
steps:
6363
- name: "Publish to Qiita"
64-
uses: noraworld/github-to-qiita@v0.2.0
64+
uses: noraworld/github-to-qiita@v1.0.0
6565
with:
6666
dir: "articles"
6767
qiita_access_token: ${{ secrets.QIITA_ACCESS_TOKEN }}
68+
mapping_filepath: "mapping.txt"
69+
strict: false
6870
```
6971
7072
上記の YAML コードの一部を以下の情報に置き換えます。
@@ -74,11 +76,17 @@ jobs:
7476
| `jobs.qiita.steps[*].with.dir` | Qiita に投稿したい記事が格納されているディレクトリを指定します | true | `articles` |
7577
| `jobs.qiita.steps[*].with.qiita_access_token` | Qiita アクセストークンを指定します (`${{ secrets.QIITA_ACCESS_TOKEN }}` で参照できます [^1]) | true | `${{ secrets.QIITA_ACCESS_TOKEN }}` |
7678
| `jobs.qiita.steps[*].with.mapping_filepath` | マッピングファイルのパスを指定します | false | `mapping.txt` |
79+
| `jobs.qiita.steps[*].with.strict` | 厳密チェックモードをオンにするかオフにするかを指定します | false | `false` |
7780

7881
[^1]: 一つ前の手順でリポジトリに設定した環境変数名が `QIITA_ACCESS_TOKEN` である場合のみ。
7982

8083
**WARNING:** 最新版のコードはバグを含んでいたり仕様が頻繁に変わったりする可能性があるため、`jobs.qiita.steps[*].uses` でバージョンを `@main` に設定しないでください。最新のタグのバージョンを指定することをおすすめします。タグ一覧は [Tags](/../../tags) からアクセスできます。
8184

85+
#### 厳密チェックモードについて
86+
厳密チェックモードは Qiita 上に記事が見つからない、かつ、リポジトリ上の記事ファイルが追加ではなく更新された場合に、Qiita に該当記事を投稿するかどうかを指定します。厳密チェックモードがオン (`jobs.qiita.steps[*].with.strict` が `true` に設定されている) の場合、マッピングファイルが不完全なために該当する Qiita の記事が見つからず、記事ファイルが更新された場合には Qiita に投稿されません。厳密チェックモードがオフの場合は Qiita に投稿されます。
87+
88+
厳密チェックモードをオフにすると、Qiita に該当記事が存在していても、マッピング情報が不完全であるために、新しい記事として Qiita に投稿されてしまう可能性があります。そのため、マッピング情報が不完全な場合は厳密チェックモードをオンにすることをおすすめします。ただし、新しい記事ファイルをプッシュした際に何らかの理由で Qiita への投稿が失敗した場合に、手動で Qiita に投稿しない限りはその記事が投稿されることがない点にご注意ください。この問題を回避したい場合は `jobs.qiita.steps[*].with.strict` を `false` に設定することをご検討ください。
89+
8290
---
8391

8492
設定はこれで以上となります。
@@ -148,6 +156,7 @@ ADDED_FILES="articles/test01.md"
148156
MODIFIED_FILES="articles/test02.md"
149157
MAPPING_FILEPATH="mapping.txt"
150158
QIITA_ACCESS_TOKEN="7f6c7aec310ded84ae3acfe8f920cb1c7556c7d3" # これはサンプル値です!!
159+
STRICT="true"
151160
```
152161

153162
| 環境変数名 | 説明 | 必須かどうか |
@@ -156,6 +165,7 @@ QIITA_ACCESS_TOKEN="7f6c7aec310ded84ae3acfe8f920cb1c7556c7d3" # これはサン
156165
| `MODIFIED_FILES` | 編集される記事のパス | false |
157166
| `MAPPING_FILEPATH` | マッピング情報を格納するファイルのパス | true |
158167
| `QIITA_ACCESS_TOKEN` | Qiita アクセストークン (開発用) | true |
168+
| `STRICT` | 厳密チェックモードをオンにするかどうか ([厳密チェックモードについて](#厳密チェックモードについて) を参照) | true |
159169

160170
**NOTE:** 本番用とは異なる Qiita アクセストークンを使用することをおすすめします。
161171

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.