name: 'README Update Pull Request' on: # pull_request: # paths: # - 'README.md' workflow_dispatch: jobs: build: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 - name: Set up Go uses: actions/setup-go@v3 with: go-version: '1.21' - name: Install Sorter run: | go install github.com/awesome-jellyfin/clients-md-generator/cmd/sort@v1.0.1 - name: Sort README id: sorting run: | go run github.com/awesome-jellyfin/clients-md-generator/cmd/sort@v1.0.1 \ -input README.md \ -out-file README.sorted.md \ -out-stdout \ -fail continue-on-error: true - name: Generate Comment Body on Failure if: steps.sorting.outcome == 'failure' run: | cat < comment_body.txt **Thank you for your contribution! ❤️** We found sorting changes in README.md. Here is a diff showing what changed:
README.md diff \`\`\`diff $(diff -u README.md README.sorted.md || true) \`\`\`
EOF - name: Generate Comment Body on Success if: steps.sorting.outcome != 'failure' run: | cat < comment_body.txt **Thank you for your contribution! ❤️** No issues found with the ordering. EOF - name: Find Comment from Linter uses: peter-evans/find-comment@v3 id: fc with: issue-number: ${{ github.event.number }} comment-author: 'awesome-jellyfin-bot' body-includes: '' - name: Create or Update Sorting Diff Comment uses: peter-evans/create-or-update-comment@v4 with: token: ${{ secrets.AWESOME_JELLYFIN_BOT_TOKEN }} comment-id: ${{ steps.fc.outputs.comment-id }} issue-number: ${{ github.event.number }} body-path: comment_body.txt edit-mode: replace - name: Fail if sorting changed if: steps.sorting.outcome == 'failure' run: | echo "README.md requires sorting. Failing the pipeline." exit 1