Skip to content

Conversation

@qmonnet
Copy link
Member

@qmonnet qmonnet commented Apr 9, 2025

Automation

The API reference generated in this repository is published via the docs repository for the project. This means that we regularly need to synchronize the document.

Instead of manually copying the API reference and creating a new Pull Request in the docs repo, let's add a workflow to automate this task. The workflow runs each time a new version tag is created in the fabric repository.

Test

The workflow was tested successfully between my own forks of the fabric and docs repositories, leading to the automated creation of qmonnet/hhdocs#1 when I pushed a tag to my fork.

Authentication

For my test I used a fine-grained PAT (using the scope from the docs), passed as a repository secret. For the upstream fabric repo we probably need something different, something that makes the github-actions bot the author of the PR, maybe a GitHub App token? I'm not familiar with using those, though.

@qmonnet qmonnet added the github_actions Pull requests that update GitHub Actions code label Apr 9, 2025
@qmonnet qmonnet requested a review from mrbojangles3 April 9, 2025 10:36
@qmonnet qmonnet marked this pull request as ready for review April 14, 2025 11:44
@qmonnet qmonnet requested a review from Frostman as a code owner April 14, 2025 11:44
@Frostman
Copy link
Member

I've added the application and installed it only for the docs repo. I've added secrets for the fabric, fabricator, and gateway repos, as all of them will need docs to be synced.

@Frostman Frostman force-pushed the pr/qmonnet/automate-api-ref-push branch from ff24430 to 11979ca Compare April 15, 2025 19:20
qmonnet added 2 commits April 15, 2025 12:20
The API reference generated in this repository is published via the
"docs" repository for the project. This means that we regularly need to
synchronize the document.

Instead of manually copying the API reference and creating a new Pull
Request in the "docs" repo, let's add a workflow to automate this task.
The workflow runs each time a new version tag is created in the "fabric"
repository.

Signed-off-by: Quentin Monnet <[email protected]>
Let's use the create-github-app-token Action to generate a GitHub App
token for the 'docs' repository, so that we can create a Pull Request
there, to sync up the API reference.

Comparing to a personal access token, this solution has the advantage of
making the GitHub App, rather than the contributor owning the token, the
author of the generated Pull Request.

Link: https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens
Link: https://github.com/actions/create-github-app-token#usage
Signed-off-by: Quentin Monnet <[email protected]>
@Frostman Frostman force-pushed the pr/qmonnet/automate-api-ref-push branch from 11979ca to c0eff2d Compare April 15, 2025 19:20
- created and installed app, added secrets with id and key
- adding note on when to merge a pr

Signed-off-by: Sergei Lukianov <[email protected]>
@Frostman Frostman force-pushed the pr/qmonnet/automate-api-ref-push branch from c0eff2d to 8683dff Compare April 15, 2025 19:47
@Frostman Frostman merged commit 7859c62 into master Apr 15, 2025
9 checks passed
@Frostman Frostman deleted the pr/qmonnet/automate-api-ref-push branch April 15, 2025 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants