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

fix: published_at being set even if published: true already set #392

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

korosuke613
Copy link
Owner

@korosuke613 korosuke613 commented Oct 30, 2024

Fixes #310

Prevent setting published_at when published: true is already set.

  • src/functions.ts
    • Update updateZennMetadata to exclude published_at when published: true.
    • Add a check to skip updating published_at if published: true is already set.
  • src/tests/main.test.ts
    • Add a test to verify published_at is not set when published: true.
    • Update existing test to include published: true and verify published_at is updated only when published: false.
  • .devcontainer.json
    • Add a devcontainer configuration file with a test task.

For more details, open the Copilot Workspace session.

Fixes #310

Prevent setting `published_at` when `published: true` is already set.

* **src/functions.ts**
  - Update `updateZennMetadata` to exclude `published_at` when `published: true`.
  - Add a check to skip updating `published_at` if `published: true` is already set.
* **src/__tests__/main.test.ts**
  - Add a test to verify `published_at` is not set when `published: true`.
  - Update existing test to include `published: true` and verify `published_at` is updated only when `published: false`.
* **.devcontainer.json**
  - Add a devcontainer configuration file with a test task.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/korosuke613/zenn-metadata-updater-action/issues/310?shareId=XXXX-XXXX-XXXX-XXXX).
@korosuke613 korosuke613 merged commit 70a9414 into main Oct 30, 2024
7 checks passed
@korosuke613 korosuke613 deleted the fix-published-at branch October 30, 2024 14:43
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.

published: true がすでに設定されていても published_at を設定してしまう
1 participant