Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .github/workflows/code-embedder.yml

This file was deleted.

9 changes: 5 additions & 4 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ name: Check PR title
on:
pull_request:

permissions:
pull-requests: write

jobs:
lint:
check_pr_title:
runs-on: ubuntu-latest
permissions:
statuses: write
steps:
- uses: step-security/conventional-pr-title-action@v3.2.0
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,28 @@ This action:
## Workflow file structure
To use this action, you need to configure a yaml workflow file in `.github/workflows` folder (e.g. `.github/workflows/code-embedder.yaml`) with the following content:

```yaml:.github/workflows/code-embedder.yaml
```yaml:.github/workflows/code-embedder.yml
name: Code Embedder

on: pull_request

jobs:
code_embedder:
name: "Code embedder"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Run code embedder
uses: kvankova/code-embedder@0.0.1
with:
readme_path: README.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

```
It requires a secret `GITHUB_TOKEN` with write and repo permission.

Expand All @@ -26,7 +47,7 @@ You can specify which README file you want to update with `readme_path` (path to
it supports only one readme file, and if not specified, it will by default look for it in the root `README.md`.

The action looks for the following sections in the readme file based on which it will update the code snippets:
````
````md
```language:path/to/script
```
````
Expand All @@ -35,19 +56,21 @@ These sections will be filled in by content of path/to/script and updated with u
## Example

You will add the code block sections with path to the scripts in the following format:
````
````md
# README

This is a readme.

```python:main.py
```
````
And once the worklow runs, the code block sections will be filled with the content of the script and updated in the readme file.

````
````md
# README

This is a readme.

```python:main.py
print("Embedding successful")
```
Expand Down
1 change: 0 additions & 1 deletion examples/example.py

This file was deleted.

Loading