Merge pull request #10 from pnnl/debug/ci #36
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
| # .github/workflows/update-readme-badge.yml | |
| name: Update README from Template | |
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| update-readme: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: true | |
| - name: Generate README.md from template | |
| run: | | |
| CI_BADGE="[](https://github.com/${{ github.repository }}/actions/workflows/ci.yml)" | |
| CODECOV_BADGE="[](https://codecov.io/gh/${{ github.repository }})" | |
| sed -e "s|<!-- CI_BADGE -->|$CI_BADGE|" \ | |
| -e "s|<!-- CODECOV_BADGE -->|$CODECOV_BADGE|" \ | |
| README.md.template > README.md | |
| - name: Commit and push if README.md changed | |
| run: | | |
| if git diff --quiet -- README.md; then | |
| echo "README.md unchanged; nothing to commit." | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add README.md | |
| git commit -m "chore: auto-update README from template [skip ci]" || exit 0 | |
| git push | |
| # # .github/workflows/update-readme-badge.yml | |
| # name: Update README from Template | |
| # on: | |
| # push: | |
| # branches: [ main ] | |
| # workflow_dispatch: | |
| # jobs: | |
| # update-readme: | |
| # runs-on: ubuntu-latest | |
| # permissions: | |
| # contents: write # IMPORTANT: allow this workflow to push | |
| # steps: | |
| # - name: Checkout repo | |
| # uses: actions/checkout@v4 | |
| # with: | |
| # persist-credentials: true # use GITHUB_TOKEN so we can push | |
| # # .github/workflows/update-readme-badge.yml | |
| # name: Update README from Template | |
| # on: | |
| # push: | |
| # branches: [ main ] | |
| # workflow_dispatch: | |
| # jobs: | |
| # update-readme: | |
| # runs-on: ubuntu-latest | |
| # permissions: | |
| # contents: write # IMPORTANT: allow this workflow to push | |
| # steps: | |
| # - name: Checkout repo | |
| # uses: actions/checkout@v4 | |
| # with: | |
| # persist-credentials: true # use GITHUB_TOKEN so we can push | |
| # - name: Generate README.md from template | |
| # run: | | |
| # CI_BADGE="[](https://github.com/${{ github.repository }}/actions/workflows/ci.yml)" | |
| # CODECOV_BADGE="[](https://codecov.io/gh/${{ github.repository }})" | |
| # sed -e "s|<!-- CI_BADGE -->|$CI_BADGE|" \ | |
| # -e "s|<!-- CODECOV_BADGE -->|$CODECOV_BADGE|" \ | |
| # README.md.template > README.md | |
| # - name: Commit and push if README.md changed | |
| # run: | | |
| # # If README.md is unchanged, do nothing | |
| # if git diff --quiet -- README.md; then | |
| # echo "README.md unchanged; nothing to commit." | |
| # exit 0 | |
| # fi | |
| # git config user.name "github-actions[bot]" | |
| # git config user.email "github-actions[bot]@users.noreply.github.com" | |
| # git add README.md | |
| # git commit -m "chore: auto-update README from template [skip ci]" || exit 0 | |
| # git push | |
| # # - name: Generate README.md from template | |
| # # run: | | |
| # # CI_BADGE="[](https://github.com/${{ github.repository }}/actions/workflows/ci.yml)" | |
| # # CODECOV_BADGE="[](https://codecov.io/gh/${{ github.repository }})" | |
| # # sed -e "s|<!-- CI_BADGE -->|$CI_BADGE|" \ | |
| # # -e "s|<!-- CODECOV_BADGE -->|$CODECOV_BADGE|" \ | |
| # # README.md.template > README.md | |
| # # - name: Commit and push if README.md changed | |
| # # run: | | |
| # # # If README.md is unchanged, do nothing | |
| # # if git diff --quiet -- README.md; then | |
| # # echo "README.md unchanged; nothing to commit." | |
| # # exit 0 | |
| # # fi | |
| # # git config user.name "github-actions[bot]" | |
| # # git config user.email "github-actions[bot]@users.noreply.github.com" | |
| # # git add README.md | |
| # # git commit -m "chore: auto-update README from template [skip ci]" || exit 0 | |
| # # git push |