diff --git a/.github/workflows/code-embedder.yml b/.github/workflows/code-embedder.yml deleted file mode 100644 index c956dfa..0000000 --- a/.github/workflows/code-embedder.yml +++ /dev/null @@ -1,20 +0,0 @@ -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 }} diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml index 8fb7d05..fec31c1 100644 --- a/.github/workflows/pr-title.yml +++ b/.github/workflows/pr-title.yml @@ -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 }} diff --git a/README.md b/README.md index 2248def..5fa2588 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 ``` ```` @@ -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") ``` diff --git a/examples/example.py b/examples/example.py deleted file mode 100644 index 42435c7..0000000 --- a/examples/example.py +++ /dev/null @@ -1 +0,0 @@ -print("Code to embed")