Skip to content

Commit

Permalink
close vote
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrusch committed Dec 10, 2023
1 parent 9f00c81 commit 42e6c60
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/close.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Close vote

on:
pull_request:
types:
- closed
workflow_dispatch:
branches: [ main ]

jobs:
get_prs:
if: ${{ github.event_name != 'pull_request' ||
github.event.pull_request.merged == false
# github.event.pull_request.merged == true &&
contains(github.event.pull_request.labels.*.name, 'paper-vote') }}
runs-on: ubuntu-latest
steps:
- name: Pull Requests
uses: buildsville/list-pull-requests@v1
id: list
with:
token: ${{secrets.GITHUB_TOKEN}}
labels: '["paper-vote"]'
- name: Close vote options
run: |
echo "PRS=${{ steps.list.outputs.pulls }}" >> $GITHUB_ENV
close_prs:
needs: get_prs
if: ${{ env.PRS }}
runs-on: ubuntu-latest
strategy:
matrix:
pr: ${{ env.PRS }}
steps:
- name: Close Pull
uses: peter-evans/close-pull@v3
with:
pull-request-number: ${{ matrix.pr }}
comment: Auto-closing pull request
delete-branch: true
4 changes: 2 additions & 2 deletions .github/workflows/vote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
uses: peter-evans/create-pull-request@v4
with:
add-paths: files/*.txt
labels: paper-vote
labels: paper-vote next-paper
branch: paper-vote-${{ matrix.options }}
delete-branch: true
title: ${{ steps.vars.outputs.title }}
Expand Down Expand Up @@ -97,4 +97,4 @@ jobs:
DISCORD_AVATAR: ${{ env.AVATAR }}
uses: Ilshidur/action-discord@master
with:
args: "**Voting Instructions.**\n- Rank vote papers using numbers :one: — :three: favorite -- least favorite.\n- Set the winner by merging its PR."
args: "**Voting Instructions.**\n- Rank papers using number reactions :one: favorite — :three: least favorite.\n- Set the winner by merging its PR."

0 comments on commit 42e6c60

Please sign in to comment.