This project contains GitHub Actions workflows designed to automate project management tasks for the podaac organization. These workflows can be deployed across all repositories in the organization to ensure consistent handling of issues and pull requests.
This workflow automatically adds new issues and pull requests to the podaac organization project with a default status of "needs:triage".
When an issue or pull request is closed, the "closed" status is automatically assigned in the podaac project. It does not matter that it has not been assigned to a team as the ticket is closed and no work is expected on it anymore.
- The workflow file must exist in each repository where you want it to run
- A workflow in the
.githubrepository will NOT trigger for issues/PRs in other repositories - You must deploy this workflow to all repositories where you want automatic project assignment
This repository provides automation scripts to help deploy the workflow across all your organization's repositories.
-
Find your project number:
- Go to your project URL:
https://github.com/orgs/podaac/projects/X - The number
Xin the URL is your project number - Update line 20 in
.github/workflows/add-to-project.ymlwith this number
- Go to your project URL:
-
Create a Personal Access Token (PAT):
- Go to https://github.com/settings/tokens/new
- Select "Generate new token (classic)" or use fine-grained tokens
- Required scopes:
repo(Full control of private repositories)project(Full control of projects)org:read(Read org and team membership, read org projects)
- Generate and copy the token
-
Add the token as a secret:
-
For organization-wide use:
- Go to
https://github.com/organizations/podaac/settings/secrets/actions - Click "New organization secret"
- Name:
PROJECTS_PAT - Value: Paste your token
- Repository access: Set to "All repositories" or select specific repos
- Go to
-
For a single repository:
- Go to repository Settings > Secrets and variables > Actions
- Click "New repository secret"
- Name:
PROJECTS_PAT - Value: Paste your token
-
-
Verify the status field name:
- Open your project in GitHub
- Check that you have a "Status" field with a "needs:triage" option
- If the field or option has a different name, update the script accordingly
-
Deploy the workflow:
Option A: Automated deployment (Recommended)
Use the provided scripts to deploy to all repositories:
# Deploy via Pull Requests (safer, allows review) ./deploy-workflow.sh # OR deploy directly to main branch (faster, but no review) ./deploy-workflow-direct.sh
Prerequisites:
- GitHub CLI (
gh) must be installed and authenticated - You need write access to all repositories in the organization
Option B: Manual deployment
Copy the workflow file to each repository:
cd /path/to/your/repo mkdir -p .github/workflows cp /path/to/this/repo/.github/workflows/add-to-project.yml .github/workflows/ git add .github/workflows/add-to-project.yml git commit -m "Add automatic project assignment workflow" git push
- GitHub CLI (
- Triggers: When a new issue or pull request is opened
- Actions:
- Adds the item to the specified project using the
actions/add-to-projectaction - Sets the status field to "needs:triage" using the GitHub GraphQL API
- Adds the item to the specified project using the
- If items aren't being added, check that the PAT has sufficient permissions
- If the status isn't being set, verify the field name and option name in your project
- Check the Actions tab in your repository for error logs
- Ensure the project number is correct in the workflow file
To change the default status, modify line 35 in the workflow:
const triageOption = statusField?.options.find(option => option.name === 'needs:triage');Replace 'needs:triage' with your desired status option name.
All the new tickets are now automatically added to the podaac github project with a default status of "needs:triage". This allows the team to easily find and triage new issues and pull requests in one central location.
The action triage-report-to-slack sends a message to the #podaac-management channel in Slack whenever a new issue or pull request is created with the "needs:triage" status. This ensures that the team is immediately notified of new items that require attention and that no issue falls into cracks.
The Slack connection is configured using a webhook URL stored in the SLACK_WEBHOOK_URL secret. You can get the webhoob URL by creating an incoming webhook in your Slack workspace for a slack application, currently called "podaac issues needs triage".
This workflow automates the process of assigning issues to specific teams when they are labeled with a team:<team_name> label (e.g., team:tva, team:forge, etc.).
- Trigger: When an issue is labeled with a label matching the pattern
team:<team_name> - Actions:
- Updates the status in the podaac project (project #75) to "triaged"
- Searches for an organization project named exactly as the team name (e.g., a project named "tva" for the label "team:tva")
- If the team project exists:
- Adds the issue to the team project (if not already there)
- Status is managed by the team project's automation workflows
- If no matching team project is found, logs a notice and completes gracefully
-
Use the PAT configured for other workflows:
- This workflow uses the same
PROJECTS_PATsecret as the other workflows - Ensure the PAT has the required permissions (see "Add to Project Workflow" section above)
- This workflow uses the same
-
Configure your team projects:
- Create organization projects named after your teams (e.g., "tva", "pse", ...)
- Configure project automation workflows in each team project to handle status assignments
- The project name match is case-insensitive
-
Create team labels:
- Create labels in your repositories following the pattern:
team:<team_name> - Examples:
team:tva,team:pse,team:pde, etc... - These can be created at the organization level or per-repository
- Create labels in your repositories following the pattern:
-
Deploy the workflow:
chmod +x deploy-team-assignment-direct.sh ./deploy-team-assignment-direct.sh
- An issue is created and automatically added to the podaac project with "needs:triage" status
- A team lead reviews the issue and applies the appropriate team label (e.g.,
team:tva) - The workflow automatically:
- Changes the status in podaac project from "needs:triage" to "triaged"
- Adds the issue to the team's project (if it exists)
- The team project's automation workflows handle status assignment
- Status not updating to "triaged": Verify the issue is in the podaac project and has a "triaged" status option
- Issue not added to team project: Check that a project exists with the exact team name (case-insensitive)
- Workflow not triggering: Ensure the label matches the pattern
team:<team_name>exactly
- Issue #123 is created → automatically added to podaac project with status "needs:triage"
- Team lead adds label
team:tvato issue #123 - Workflow runs:
- ✅ Updates status to "triaged" in podaac project
- ✅ Finds project named "tva"
- ✅ Adds issue #123 to "tva" project
- ✅ Team project automation handles status assignment