Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GitHub Action] Auto-apply Todo/In Progress status to 'urgent' issues #97

Open
mbz4 opened this issue Apr 21, 2024 · 0 comments
Open

[GitHub Action] Auto-apply Todo/In Progress status to 'urgent' issues #97

mbz4 opened this issue Apr 21, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@mbz4
Copy link
Collaborator

mbz4 commented Apr 21, 2024

With GitHub Actions, we add more flexibility to create workflows that meet more advanced project needs.
We can automate various processes and integrate with other GitHub features to streamline project management.
Also, if we have specific permissions or restrictions, GitHub Actions offers a way to work around limitations while automating tasks effectively.

How to create a custom GitHub workflow that moves an issue to a specific project column when it's labeled urgent:

  1. In IoTempower repo, navigate to .github/workflows
  • Create a new file, e.g., move-urgent-issues.yml
  • Define the Workflow (example):
name: Move Urgent Issues
on:
  issues:
    types: [labeled]

jobs:
  move-urgent:
    if: github.event.label.name == 'urgent'
    runs-on: ubuntu-latest
    steps:
      - name: Get issue details
        id: issue
        uses: actions/github-script@v6
        with:
          script: |
            const issue_number = context.payload.issue.number;
            return { issue_number: issue_number };

      - name: Move issue to "ToDo" column
        uses: actions/github-script@v6
        with:
          script: |
            const issue_number = steps.issue.outputs.issue_number;
            const project_column_id = 'YOUR_PROJECT_COLUMN_ID';  # Get this ID from your GitHub Project
            await github.projects.moveProjectCard({
              card_id: issue_number,
              position: 'top',  # or 'bottom'
              column_id: project_column_id,
            });
  1. Configure the workflow to trigger when an issue is labeled
  • Find the Project Column ID:

3, Go to the GitHub Project board.

  • Inspect the status column where you want to move issues (e.g., 'To Do' or 'In Progress').
  • Find the column's ID through the GitHub API or by inspecting the page elements.
  1. Commit and Push / Pull Request
  • Add the new workflow file to the repo
  • Test by creating an issue and adding the urgent label to ensure it moves to the correct column.
@mbz4 mbz4 self-assigned this Apr 21, 2024
@mbz4 mbz4 converted this from a draft issue Apr 21, 2024
@mbz4 mbz4 added enhancement New feature or request question Further information is requested labels Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
Status: Backlog 🔜
Development

No branches or pull requests

1 participant