-
Notifications
You must be signed in to change notification settings - Fork 18
Add xml to yaml converter, update Markdown and Yaml files automatically when pull requests are merged #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a8f1110
Update tools/write_standard_name_table.py: linting, basic output to
climbfuji fb2ab9e
Update tools/write_standard_name_table.py: comments now properly form…
265773e
Remove Metadata-standard-names.md
8557580
Add Metadata-standard-names.yaml and Metadata-standard-names.md
6f915bf
In tools/write_standard_name_table.py, make output format a required …
e743db1
Update .github/workflows/pull_request_ci.yml: test rendering to md an…
7216533
Update Metadata-standard-names.md
climbfuji 1e7b451
Add .github/workflows/commit_to_main.yml
9354ba3
Merge branch 'main' of https://github.com/climbfuji/ccppstandardnames…
fcb7a39
Add comments to GitHub action workflows that explain maining of git diff
7c613d0
Clean up .github/workflows/commit_to_main.yml and update README.md
653c8d2
Update tools/write_standard_name_table.py
climbfuji 9097066
Only commit once from GitHub actions, just before push
97c9736
Update .github/workflows/pull_request_ci.yml: add workflow_dispatch b…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: Render xml standard name dictionary to markdown and yaml and commit to repository | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| update-md-and-yaml: | ||
| name: Render xml to markdown and yaml and commit | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: "3.x" | ||
|
|
||
| - name: Configure git | ||
| run: | | ||
| git config --global user.name "github-actions[bot]" | ||
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get -y install libxml2-utils | ||
| python -m pip install --upgrade pip | ||
| python -m pip install PyYaml | ||
|
|
||
| - name: Render xml to markdown | ||
| run: | | ||
| tools/write_standard_name_table.py --output-format md standard_names.xml | ||
| echo "The following changes will be committed (git diff Metadata-standard-names.md):" | ||
| git diff Metadata-standard-names.md | ||
| git add Metadata-standard-names.md | ||
|
|
||
| - name: Rendering xml to yaml | ||
| run: | | ||
| tools/write_standard_name_table.py --output-format yaml standard_names.xml | ||
| echo "The following changes will be committed (git diff Metadata-standard-names.yaml):" | ||
| git diff Metadata-standard-names.yaml | ||
| git add Metadata-standard-names.yaml | ||
|
|
||
| - name: Commit and push changes | ||
| run: | | ||
| git commit -m "Update Metadata-standard-names.{md,yaml} from standard_names.xml" || echo "No changes to commit" | ||
| git push | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore this - to prove that the auto update works. The file will be re-rendered from the XML and submitted to the repository when this PR is merged.