Skip to content

ci(comment): make workflow reusable #8

ci(comment): make workflow reusable

ci(comment): make workflow reusable #8

Workflow file for this run

---

Check failure on line 1 in .github/workflows/check-files.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/check-files.yml

Invalid workflow file

(Line: 80, Col: 9): Unexpected value 'secrets'
name: "check-files"
on: # yamllint disable-line rule:truthy
pull_request:
branches: [master]
paths:
- 'source/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}
cancel-in-progress: true
defaults:
run:
shell: bash
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
container:
image: ghcr.io/texasinstruments/processor-sdk-doc:latest
options: --entrypoint /bin/bash
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Update refs and settings
run: |
git config --global --add safe.directory "$PWD"
git switch -C pr
git fetch --no-tags --depth=1 origin master
git switch master
- name: Run check_files.py
id: check
env:
EVENT_NUMBER: ${{ github.event.number }}
run: |
# Disable color output
export NO_COLOR=true
# Run the test
bin/delta.sh -a master -b pr -- ./bin/check_files.py
# Prepare summary
WARNING_COUNT=$(wc -l < _new-warn.log)
if [ "$WARNING_COUNT" -gt "0" ]; then
echo "New unreachable files found with check_files.py:"
echo '```text'
cat _new-warn.log
echo '```'
else
echo "No new unreachable files found with check_files.py"
fi >> "$GITHUB_STEP_SUMMARY"
# Prepare the output
SUMMARY=$(< "$GITHUB_STEP_SUMMARY")
echo "issue_number=$EVENT_NUMBER" >> "$GITHUB_OUTPUT"
echo "problem_count=$WARNING_COUNT" >> "$GITHUB_OUTPUT"
echo "summary=$SUMMARY" >> "$GITHUB_OUTPUT"
# Exit with error if there are new warnings
[ "$WARNING_COUNT" -eq "0" ]
- name: Comment
uses: ./.github/workflows/comment.yml
if: always()
with:
issue_number: ${{ steps.check.outputs.issue_number }}
problem_count: ${{ steps.check.outputs.problem_count }}
summary: ${{ steps.check.outputs.summary }}
secrets: inherit