Two composite GitHub Actions for stashing structured JSON inside a pull request body, hidden in an HTML comment. Useful for passing state between workflow runs without a separate store.
The metadata block looks like this and is invisible in the rendered PR description:
<!-- pr-meta: {"version":"1.2.3","reviewed":true} -->Both are composite actions that wrap actions/github-script@v7. No build step, no extra setup.
| Name | Required | Default | Description |
|---|---|---|---|
github-token |
no | ${{ github.token }} |
Token used for the REST API fallback |
marker |
no | pr-meta |
Marker name inside the HTML comment |
pr-number |
no | triggering PR | PR number to read from. Defaults to the PR from the event |
| Name | Description |
|---|---|
has-metadata |
"true" if the marker was found, "false" otherwise |
result |
Parsed JSON, stringified. Empty string if the action failed |
on:
pull_request:
jobs:
read-metadata:
runs-on: ubuntu-latest
steps:
- id: meta
uses: taskworld/pr-meta-action/read@v1
- run: echo '${{ steps.meta.outputs.result }}'
if: steps.meta.outputs.has-metadata == 'true'Must run on a pull_request event — it updates the PR body via the REST API.
permissions:
pull-requests: write| Name | Required | Default | Description |
|---|---|---|---|
github-token |
no | ${{ github.token }} |
Token used to update the PR body |
marker |
no | pr-meta |
Marker name inside the HTML comment |
data |
yes | — | JSON-stringified object to write under the marker |
merge |
no | "false" |
If "true", shallow-merge with existing metadata instead of replacing |
When merge is true, both the existing and incoming values must be plain JSON objects.
on:
pull_request:
permissions:
pull-requests: write
jobs:
write-metadata:
runs-on: ubuntu-latest
steps:
- uses: taskworld/pr-meta-action/write@v1
with:
data: '{"reviewed":true,"version":"1.2.3"}'
merge: "true"- Both actions accept a custom
marker, so you can store multiple independent JSON blobs in one PR body by using different names. writeis a no-op when the rendered body would be unchanged, so it's safe to run on every push.