Skip to content
Closed
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
29 changes: 26 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ jobs:
name: Check proposals.json and generated Markdown
runs-on: ubuntu-latest
permissions:
contents: read
contents: write

steps:
- name: Checkout
uses: actions/checkout@v7
with:
# For same-repo PRs, check out the actual PR branch (head_ref) so CI
# can push commits to it; for fork PRs and pushes, use github.ref.
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.head_ref || github.ref }}
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v7
Expand All @@ -25,5 +30,23 @@ jobs:
- name: Install jsonschema
run: pip install jsonschema

- name: Validate proposals.json and check that Markdown files are up to date
run: python generate_markdown.py --check
- name: Validate proposals.json and check or update Markdown files
env:
IS_SAME_REPO_PR: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}
BASE_REF: ${{ github.base_ref }}
run: |
# For same-repo PRs that don't modify any of the Markdown files,
# regenerate the Markdown files and commit any updates to the PR branch.
# Otherwise, run --check so we don't clobber manual Markdown edits.
if [ "$IS_SAME_REPO_PR" = "true" ] && git diff --quiet "origin/${BASE_REF}...HEAD" -- '*.md'; then
python generate_markdown.py
if ! git diff --quiet -- '*.md'; then
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add '*.md'
git commit -m 'Regenerate Markdown files from proposals.json'
git push
fi
else
python generate_markdown.py --check
fi
2 changes: 2 additions & 0 deletions howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ Add the proposal to the list of active proposals by creating a respective PR.
4. Commit `proposals.json` and `README.md` and create a PR.
**Note:** If you have write access to `WebAssembly/proposals` and create the PR on a branch in the repo (for example, by editing `proposals.json` directly in the GitHub web UI), you can skip running `./generate_markdown.py` locally and CI will commit the regenerated Markdown files to your PR automatically.
## Setting up CI and GitHub Pages
Expand Down
2 changes: 1 addition & 1 deletion proposals.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"extended-name-section": {
"name": "Extended Name Section",
"url": "https://github.com/WebAssembly/extended-name-section",
"phase": 2,
"phase": 3,
"champions": [
"Ben Visness"
]
Expand Down
Loading