disconnect template #276
Workflow file for this run
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: Random paper | |
on: | |
schedule: | |
- cron: '0 14 * * 5' | |
workflow_dispatch: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
types: [ closed ] | |
jobs: | |
choose: | |
# Workflow runs when "random paper workflow" is enabled and | |
# (a) Workflow was dispatched manually -or- | |
# (b) Paper suggestion PR was closed without merging | |
if: ${{ vars.PAPER_CHOOSE_ON == 1 && ( | |
github.event_name != 'pull_request' || | |
(contains(github.event.pull_request.labels.*.name, 'next-paper') && | |
!contains(github.event.pull_request.labels.*.name, 'paper-vote') && | |
github.event.pull_request.merged == false))}} | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: 🔮 Choose random paper | |
run: npm run choose | |
- name: 📝 Update website | |
run: npm run web | |
- name: 🔎 Lookup paper details | |
id: vars | |
run: | | |
echo "title=$(bash .github/utils/title.sh)" >> $GITHUB_OUTPUT | |
echo "body=\"$(bash .github/utils/pr.sh)\"" >> $GITHUB_OUTPUT | |
- name: 🔖️ Create a pull request | |
uses: peter-evans/create-pull-request@v6 | |
id: paperpr | |
with: | |
labels: next-paper | |
branch: next-paper | |
title: ${{ steps.vars.outputs.title }} | |
body: ${{ fromJSON(steps.vars.outputs.body) }} | |
delete-branch: true | |
reviewers: ${{ fromJSON(vars.REVIEWERS) }} | |
- name: 🤖 Enable automatic merge | |
run: gh pr merge --merge --auto ${{ steps.paperpr.outputs.pull-request-number }} | |
env: | |
GH_TOKEN: ${{ secrets.AUTOMERGE_PAT }} |