Skip to content

Commit e5a413d

Browse files
kopporGuilhermeRibeiroPereira
authored andcommitted
Split assign-workflow in issue-comment and schedule (JabRef#12704)
1 parent 531da11 commit e5a413d

File tree

2 files changed

+57
-9
lines changed

2 files changed

+57
-9
lines changed

.github/workflows/assign-issue.yml renamed to .github/workflows/on-issue-comment.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
name: Assign Issue
1+
name: On isuse comment
22

33
on:
4-
schedule:
5-
- cron: 4 12 * * *
64
issue_comment:
75
types: [created]
8-
workflow_dispatch:
96

107
jobs:
118
assign:
@@ -37,10 +34,9 @@ jobs:
3734
👋 Hey @{{ handle }}, looks like you’re eager to work on this issue—great! 🎉
3835
It also looks like you skipped reading our [CONTRIBUTING.md](https://github.com/JabRef/jabref/blob/main/CONTRIBUTING.md), which explains exactly how to participate. No worries, it happens to the best of us.
3936
Give it a read, and you’ll discover the ancient wisdom of assigning issues to yourself. Trust me, it’s worth it. 🚀
40-
- name: Move Issue to "Assigned" Column in "Candidates for University Projects"
37+
- name: Move issue corresponding column in "Candidates for University Projects"
4138
uses: m7kvqbe1/github-action-move-issues@main
42-
# Action currently works for issues only - pre-condition: https://github.com/takanome-dev/assign-issue-action/issues/269 fixed
43-
if: github.event_name == 'issue_comment'
39+
if: ${{ steps.assign.outputs.assigned == 'yes' || steps.assign.outputs.unassigned == 'yes' }}
4440
with:
4541
github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }}
4642
project-url: "https://github.com/orgs/JabRef/projects/3"
@@ -49,9 +45,9 @@ jobs:
4945
ignored-columns: ""
5046
default-column: "Free to take"
5147
skip-if-not-in-project: true
52-
- name: Move Issue to "Assigned" Column in "Good First Issues"
48+
- name: Move issue corresponding column in "Good First Issues"
5349
uses: m7kvqbe1/github-action-move-issues@main
54-
if: github.event_name == 'issue_comment'
50+
if: ${{ steps.assign.outputs.assigned == 'yes' || steps.assign.outputs.unassigned == 'yes' }}
5551
with:
5652
github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }}
5753
project-url: "https://github.com/orgs/JabRef/projects/5"
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Unassign issues
2+
3+
on:
4+
schedule:
5+
- cron: 4 12 * * *
6+
workflow_dispatch:
7+
8+
jobs:
9+
unassign_issues:
10+
if: github.repository_owner == 'JabRef'
11+
runs-on: ubuntu-latest
12+
permissions:
13+
issues: write
14+
outputs:
15+
unassigned_issues: ${{ steps.unassign.outputs.unassigned_issues }}
16+
steps:
17+
- name: Unassign stale assignments
18+
id: unassign
19+
uses: takanome-dev/assign-issue-action@edge
20+
with:
21+
github_token: '${{ secrets.GITHUB_TOKEN }}'
22+
days_until_unassign: 45
23+
move_unassigned_issues:
24+
needs: unassign_issues
25+
if: ${{ needs.unassign_issues.outputs.unassigned_issues != '[]' }}
26+
runs-on: ubuntu-latest
27+
strategy:
28+
matrix:
29+
issue_number: ${{ fromJson(needs.unassign_issues.outputs.unassigned_issues) }}
30+
steps:
31+
- name: Move issue to "Free to take" in "Good First Issues"
32+
uses: m7kvqbe1/github-action-move-issues/@add-issue-parameter
33+
with:
34+
github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }}
35+
project-url: "https://github.com/orgs/JabRef/projects/5"
36+
target-labels: "📍 Assigned"
37+
target-column: "Free to take"
38+
ignored-columns: ""
39+
default-column: "Free to take"
40+
issue-number: ${{ matrix.issue_number }}
41+
skip-if-not-in-project: true
42+
- name: Move issue to "Free to take" in "Candidates for University Projects"
43+
uses: m7kvqbe1/github-action-move-issues/@add-issue-parameter
44+
with:
45+
github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }}
46+
project-url: "https://github.com/orgs/JabRef/projects/3"
47+
target-labels: "📍 Assigned"
48+
target-column: "Free to take"
49+
ignored-columns: ""
50+
default-column: "Free to take"
51+
issue-number: ${{ matrix.issue_number }}
52+
skip-if-not-in-project: true

0 commit comments

Comments
 (0)