Skip to content

[FEATURE] Improve Filtering & Search for Projects #34

[FEATURE] Improve Filtering & Search for Projects

[FEATURE] Improve Filtering & Search for Projects #34

name: Issue Organization Automation
on:
workflow_dispatch: # Allows manual triggering
issues:
types:
- opened
- edited
pull_request:
types:
- opened
- synchronize
jobs:
organization_check:
runs-on: ubuntu-latest
steps:
- name: Add "needs organization" label if applicable
run: |
issue_number=${{ github.event.issue.number }}
repo=${{ github.repository }}
curl -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${repo}/issues/${issue_number}/labels \
-d '{"labels": ["needs organization"]}'
if: |
github.event.issue.project_card == null || github.event.issue.assignee == null
- name: Automatically add issue reference in PR description
if: ${{ github.event_name == 'pull_request' }}
run: |
pr_number="${{ github.event.pull_request.number }}"
pr_body="${{ github.event.pull_request.body }}"
if [[ ! "$pr_body" =~ "Fixes #" ]]; then
first_issue_number=$(curl -s \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/issues?state=open | jq '.[0].number')
curl -X PATCH \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-d "{\"body\": \"$pr_body\n\nFixes #${first_issue_number}\"}" \
https://api.github.com/repos/${{ github.repository }}/pulls/${pr_number}
fi