diff --git a/.github/workflows/update-editorial-board.yml b/.github/workflows/update-editorial-board.yml new file mode 100644 index 00000000..e8ce0c3a --- /dev/null +++ b/.github/workflows/update-editorial-board.yml @@ -0,0 +1,60 @@ +name: Update editorial board + +on: + workflow_dispatch: + schedule: + # Runs weekly on Wednesday at 04:21 UTC (see https://crontab.guru) + - cron: "21 4 * * 3" +jobs: + run-meta: + if: github.repository_owner == 'pyopensci' + runs-on: ubuntu-latest + steps: + - name: Check out the code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Setup Python + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v5 + with: + python-version: "3.12" + - name: Upgrade pip + run: | + # install pip=>20.1 to use "pip cache dir" + python -m pip install --upgrade pip wheel + - name: Install pyosmeta and update editorial board + env: + # Using a fine grained token here that only has team read access. + GITHUB_TOKEN_TEAMS: ${{ secrets.PYOS_READ_TEAM_MEMBERS_SECRET }} + run: | + pip install pyosmeta + update-editorial-board + + - name: Create Pull Request + uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 + with: + add-paths: | + data/editorial-board.yml + data/emeritus-editors.yml + data/contributors.yml + author: Leah + base: main + branch: editorial-board + commit-message: "Update: Editorial board file update" + delete-branch: true + title: Update editorial board data + labels: | + pre-commit.ci autofix + env: + # Custom token needed to trigger PR checks, as GITHUB_TOKEN won't + # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs + GITHUB_TOKEN: ${{ secrets.PYOS_PR_TOKEN }} + - name: Slack Notification + uses: rtCamp/action-slack-notify@33ca3be66c6f378fe1610fd1d5258632dbed5e58 #v2.4.0 + if: failure() + env: + SLACK_CHANNEL: pyos-maintainers-infrastructure + SLACK_COLOR: '#db540b' + SLACK_LINK_NAMES: true + SLACKIFY_MARKDOWN: true + SLACK_TITLE: "Update Editorial Board Workflow Failed" + SLACK_MESSAGE: "The **Update editorial board** workflow failed for pyopensci.org. Please check the logs." + SLACK_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}