Github close/reopen issue when moving cards in project columns
We moved from gitlab to github because gitlab is not free for team which has more than 5 members anymore. There’re many things we need to learn again. One of those things is the Project approach.
Contents
What’s the problem?
When issues are moved to Done or Closed column in Project board, the issue state is not changed to closed. Also when we move it from Done back to other column, it’s not be reopened. It’s a pain in the ass.
How to solve it?
Installation
- Follow the steps in README.md file
- Create personal access token
- Create repository secret which will use the personal access token as secret
- Create a workflow file in .github/workflows and push into the main/master branch
- Update the workflow file
Workflow file explanation
Here’s the workflow file I’m using for Flamingo. The workflow will be run by cron every 2 hours.
name: Project Issue State Sync
on:
schedule:
# At minute 0 every 2 hours
- cron: 0 0-23/2 * * *
workflow_dispatch:
# Manual trigger
jobs:
issue-state-sync:
runs-on: ubuntu-latest
steps:
- name: Sync issue states
uses: Saiko-Software/project-issue-state-sync@v2
with:
github_token: ${{ secrets.PROJECT_ISSUE_SYNC_TOKEN }}
owner: Saiko-Software
project_number: 11
closed_statuses: ✅ Done
open_statuses: 📋 Backlog,🔖 Ready,🏗 In progress,Test JP,👀 Test VN,Ready to Merge
- steps –> uses: I need to fork the github repository to Saiko-Software because we cannot run it directly in an organization.
- steps –> with –> github_token: the name of the secret token we created above.
- steps –> with –> owner: organization name
- steps –> with –> project_number: id of project. It’s in the project url: https://github.com/orgs/Saiko-Software/projects/11