name: Auto comment on new issues on: issues: types: [opened] permissions: issues: write contents: read jobs: comment: if: contains(github.event.issue.labels.*.name, 'bug') runs-on: ubuntu-latest steps: - name: Check for availability log file id: log env: ISSUE_BODY: ${{ github.event.issue.body }} run: | if [[ "$ISSUE_BODY" =~ (https://github\.com/user-attachments/files/[^[:space:]]+\.log) ]]; then echo "found=true" >> "$GITHUB_OUTPUT" echo "url=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT" echo "Log file found" else echo "found=false" >> "$GITHUB_OUTPUT" echo "Log file not found" fi - name: Install python if: steps.log.outputs.found == 'true' uses: actions/setup-python@v6 with: python-version: "3.14" - name: Clone folder uses: actions/checkout@v4 with: sparse-checkout: | .github/scripts/* sparse-checkout-cone-mode: false - name: Start check log if: steps.log.outputs.found == 'true' id: comment env: LOG_URL: ${{ steps.log.outputs.url }} run: | { echo "com<> "$GITHUB_OUTPUT" - name: Comment on new issue uses: peter-evans/create-or-update-comment@v5 with: issue-number: ${{ github.event.issue.number }} body-path: ${{ steps.log.outputs.found == 'true' && steps.comment.outputs.com || '.github/scripts/answers/default.md' }}