Track and commit only files modified by digest updates #19
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
| name: Check README.md Updates | |
| on: | |
| pull_request: | |
| paths: | |
| - 'action.yml' | |
| - 'README.md' | |
| - '.github/workflows/check-readme.yaml' | |
| permissions: {} | |
| jobs: | |
| check-readme: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Create temporary README | |
| run: | | |
| cp README.md README.md.original | |
| - name: Update temporary README with current inputs/outputs | |
| shell: bash | |
| run: | | |
| ./hack/update-inputs.sh | |
| - name: Check for differences | |
| id: diff | |
| run: | | |
| if diff -q README.md README.md.original &>/dev/null; then | |
| echo "No differences found. README.md is up-to-date." | |
| echo "up_to_date=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "Differences found. README.md needs to be updated." | |
| diff -u README.md.original README.md || true | |
| echo "up_to_date=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Fail if README.md is not updated | |
| if: steps.diff.outputs.up_to_date == 'false' | |
| run: | | |
| echo "::error::README.md needs to be updated to reflect the current inputs/outputs in action.yml" | |
| echo "Please run the ./hack/update-inputs.sh script and commit the changes." | |
| exit 1 |