Logo Rotation PR Bot #23
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: Logo Rotation PR Bot | |
| on: | |
| schedule: | |
| - cron: "17 3 * * *" | |
| workflow_dispatch: | |
| inputs: | |
| date: | |
| description: "Optional YYYY-MM-DD date override for testing" | |
| required: false | |
| type: string | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| rotate-logo: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -r .github/logo-bot/requirements.txt | |
| - name: Compute active logo and update config | |
| id: logo | |
| shell: bash | |
| env: | |
| INPUT_DATE: ${{ inputs.date }} | |
| run: | | |
| set -euo pipefail | |
| args=() | |
| if [[ -n "${INPUT_DATE}" ]]; then | |
| args+=(--today "${INPUT_DATE}") | |
| fi | |
| python .github/logo-bot/update_logo.py "${args[@]}" --github-output "$GITHUB_OUTPUT" | |
| - name: Create pull request | |
| if: steps.logo.outputs.changed == 'true' | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| branch: ${{ steps.logo.outputs.branch }} | |
| title: ${{ steps.logo.outputs.pr_title }} | |
| commit-message: ${{ steps.logo.outputs.commit_message }} | |
| body: | | |
| Automated logo rotation update. | |
| - Date: ${{ inputs.date || github.run_started_at }} | |
| - Event: ${{ steps.logo.outputs.event_name }} | |
| - Window: ${{ steps.logo.outputs.window }} | |
| - New logo: ${{ steps.logo.outputs.desired_logo }} | |
| - Event URL: ${{ steps.logo.outputs.event_url }} | |
| - Previous logo: ${{ steps.logo.outputs.current_logo }} | |
| - Previous event URL: ${{ steps.logo.outputs.current_event_url }} | |
| This PR was generated by `.github/workflows/logo-rotation-pr.yml`. | |
| add-paths: | | |
| _config.yml | |
| labels: | | |
| automation | |
| website |