AI: Wrap Seqera AI prompt in <details>
#543
This file contains 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: Fix linting | |
on: | |
issue_comment: | |
types: [created] | |
jobs: | |
fix_linting: | |
runs-on: ubuntu-latest | |
# Only run if comment is on a PR with the main repo, and if it contains the magic keywords | |
if: > | |
github.repository_owner == 'MultiQC' && | |
github.event.issue.pull_request && | |
startsWith(github.event.comment.body, '@multiqc-bot fix linting') | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.MQC_BOT_GITHUB_TOKEN }} | |
# Action runs on the issue comment, so we don't get the PR by default. | |
# Use the GitHub CLI to check out the PR: | |
- name: Checkout Pull Request | |
env: | |
GITHUB_TOKEN: ${{ secrets.MQC_BOT_GITHUB_TOKEN }} | |
run: gh pr checkout ${{ github.event.issue.number }} | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: "pip" | |
- name: Install pre-commit | |
run: | | |
python -m pip install --upgrade pip | |
pip install pre-commit | |
pre-commit install | |
- name: Run pre-commit | |
run: | | |
pre-commit run --all-files || true | |
- name: Check if any files changed | |
run: | | |
git diff --exit-code || echo "changed=YES" >> $GITHUB_ENV | |
echo "Files changed: ${{ env.changed }}" | |
- name: Commit and push changes | |
if: env.changed == 'YES' | |
run: | | |
git config user.name 'MultiQC Bot' | |
git config user.email 'multiqc-bot@seqera.io' | |
git config push.default upstream | |
git add . | |
git status | |
git commit -m "[automated] Fix code linting" | |
git push |