# this article is published to dev to with github action

Happy New year!

I have been writing "Today I learned (TIL)" article for a while. These are short note about development things that I learned and stored as a collection of [markdown file in GitHub](https://github.com/yulrizka/til). I hosted it with [GitBook](https://www.gitbook.com/) on <https://til.yulrizka.com>

As articles are already written in Markdown, I would like to have this synchronized to my [Dev.to](https://dev.to/yulrizka) whenever there is update to the contents. The idea is to run a script on new commit that sync the change to Dev.to.

So, I have created a small [golang script](https://github.com/yulrizka/til/blob/master/.scripts/main.go) that triggered in a GitHub action workflow that does:

1. Figure out markdown file that added or changed in the current commit.
2. Fetch all articles from *Dev.to* via an API.
3. For each local article, compare it to Dev.to (using a canonical URL).
4. Create or Update the article accordingly via the API.

This is an example of the pipeline running <https://github.com/yulrizka/til/actions/runs/3812108410>

I wrote stuff about cli tricks, git, network, go, etc. Check out the full list on <https://til.yulrizka.com>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://til.yulrizka.com/web/this-article-is-published-to-dev-to-with-github-action.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
