Skip to content

Setup repository for GitHub Actions Marketplace with comprehensive automation suite#1

Merged
kiyarose merged 4 commits intomainfrom
copilot/setup-actions-marketplace
Oct 24, 2025
Merged

Setup repository for GitHub Actions Marketplace with comprehensive automation suite#1
kiyarose merged 4 commits intomainfrom
copilot/setup-actions-marketplace

Conversation

Copy link
Contributor

Copilot AI commented Oct 24, 2025

Overview

This PR transforms the AutomationSuite repository into a fully-featured GitHub Action ready for publication on the GitHub Actions Marketplace. The action provides comprehensive automation for GitHub Issues and Pull Requests including project board management, label/milestone synchronization, and security scan auto-labeling.

What's New

Core Action Implementation (action.yml)

Created a composite GitHub Action with three powerful automation features:

  1. Project Board Automation - Integrates with GitHub Projects V2 using GraphQL API

    • Automatically adds new issues to project backlog
    • Updates linked issue status based on PR lifecycle (Backlog → In Progress → In Review)
    • Supports custom project names and configurable status transitions
  2. Label & Milestone Synchronization - Bidirectional sync between issues and PRs

    • When issue labels change, all linked open PRs are updated
    • When PR opens, it inherits labels from all linked issues
    • Smart milestone sync: applies milestone from issue to PR (or vice versa) when one is missing
    • Detects issue links using multiple patterns: #123, fixes #123, full GitHub URLs
  3. ZAP Security Scan Auto-labeling - Pattern-based automation

    • Detects issues with "ZAP Scan Baseline Report" in the title
    • Automatically applies configurable labels
    • Customizable label list via zap-labels input parameter

Configuration Options

The action is fully modular with 6 input parameters:

  • github-token (required) - GitHub API access token
  • project-name (optional, default: "Portfolio Devmt") - Name of GitHub Projects V2 project
  • enable-project-automation (optional, default: "true") - Toggle project features
  • enable-label-sync (optional, default: "true") - Toggle label/milestone sync
  • enable-zap-labeling (optional, default: "true") - Toggle ZAP auto-labeling
  • zap-labels (optional, default: "Meta,Stylistic,javascript,meta:seq,ZAP!") - Custom labels for ZAP issues

Each feature can be independently enabled or disabled, allowing users to pick only what they need.

Documentation (README.md)

Comprehensive 350+ line documentation including:

  • Quick Start - Get started in seconds with minimal configuration
  • Version Pinning - Recommendations for using @v1, @v1.0.0, or @main
  • 10+ Usage Examples - Covering basic setup, advanced configuration, selective features, and modular job setups
  • Input Parameters Table - Complete reference for all configuration options
  • Prerequisites Guide - GitHub Projects V2 setup instructions and required permissions
  • Troubleshooting Section - Common issues and solutions
  • Project Status Flow Diagram - Visual representation of issue status transitions

Example Workflow (.github/workflows/example.yml)

Provides a ready-to-use workflow file that demonstrates:

  • Proper event triggers for all features
  • Required permissions configuration
  • Full action configuration with all features enabled
  • Environment variable usage for project name

Contributing Guide (CONTRIBUTING.md)

Establishes contribution guidelines including:

  • Bug reporting and feature request templates
  • PR submission guidelines and development setup
  • Testing recommendations for all three features
  • Documentation update requirements
  • Code of conduct

Changelog (CHANGELOG.md)

Implements semantic versioning structure documenting the v1.0.0 initial release with all features.

Technical Details

  • Action Type: Composite action using actions/github-script@v7
  • No External Dependencies: Uses only built-in GitHub Actions functionality
  • GraphQL API Integration: Leverages GitHub Projects V2 GraphQL API for project management
  • Comprehensive Error Handling: Detailed logging and graceful failure handling throughout
  • Issue Linking Patterns: Supports #123, closes #123, fixes #456, resolves #789, and full GitHub URLs

Usage Example

name: Issue & PR Automation

on:
  issues:
    types: [opened, closed, reopened, labeled, unlabeled, milestoned, demilestoned, edited]
  pull_request:
    types: [opened, closed, reopened, ready_for_review, converted_to_draft, synchronize, edited]

permissions:
  issues: write
  pull-requests: write
  repository-projects: write
  contents: read

jobs:
  automation:
    runs-on: ubuntu-latest
    steps:
      - uses: SillyLittleTech/AutomationSuite@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          project-name: "My Project"

Marketplace Readiness

✅ Valid action.yml with proper metadata and branding
✅ Comprehensive documentation with examples
✅ MIT License included
✅ Contributing guidelines established
✅ Changelog with semantic versioning
✅ All YAML syntax validated

The repository is ready for tagging v1.0.0 and publishing to the GitHub Actions Marketplace.

Files Changed

  • action.yml - NEW - Main action definition (587 lines)
  • README.md - UPDATED - Comprehensive documentation (364 lines added)
  • .github/workflows/example.yml - NEW - Reference workflow
  • CHANGELOG.md - NEW - Version history
  • CONTRIBUTING.md - NEW - Contribution guidelines
  • .gitignore - UPDATED - Added IDE and temp file exclusions

Total additions: 1,112 lines across 6 files

Original prompt

make this repo setup for actions marketplace based on ```name: Issue & PR Automation Suite

on:
issues:
types: [opened, closed, reopened, labeled, unlabeled, milestoned, demilestoned, edited]
pull_request:
types: [opened, closed, reopened, ready_for_review, converted_to_draft, synchronize, edited]
pull_request_target:
types: [opened, synchronize]

permissions:
issues: write
pull-requests: write
repository-projects: write
contents: read

env:
PROJECT_NAME: "Portfolio Devmt"

jobs:
project-board-automation:
name: Project Board Integration
runs-on: ubuntu-latest
if: (github.event_name == 'issues' && github.event.action == 'opened') || github.event_name == 'pull_request'
steps:
- name: Add new issue to project backlog
if: github.event_name == 'issues' && github.event.action == 'opened'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issue = context.payload.issue;
const issueId = issue.node_id;
const issueNumber = issue.number;

        // Query to find the project and add the issue
        const findProjectQuery = `
          query($owner: String!) {
            user(login: $owner) {
              projectsV2(first: 20) {
                nodes {
                  id
                  title
                  fields(first: 20) {
                    nodes {
                      ... on ProjectV2SingleSelectField {
                        id
                        name
                        options {
                          id
                          name
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        `;
        
        try {
          // Find the project
          const projectResult = await github.graphql(findProjectQuery, {
            owner: context.repo.owner
          });
          
          const project = projectResult.user.projectsV2.nodes.find(p => 
            p.title === process.env.PROJECT_NAME
          );
          
          if (!project) {
            console.log(`❌ Project "${process.env.PROJECT_NAME}" not found`);
            console.log('Available projects:', projectResult.user.projectsV2.nodes.map(p => p.title));
            return;
          }
          
          console.log(`✅ Found project: ${project.title} (${project.id})`);
          
          // Add issue to project
          const addItemMutation = `
            mutation($projectId: ID!, $contentId: ID!) {
              addProjectV2ItemById(input: {
                projectId: $projectId
                contentId: $contentId
              }) {
                item {
                  id
                }
              }
            }
          `;
          
          const addResult = await github.graphql(addItemMutation, {
            projectId: project.id,
            contentId: issueId
          });
          
          const itemId = addResult.addProjectV2ItemById.item.id;
          console.log(`✅ Added issue #${issueNumber} to project (item ID: ${itemId})`);
          
          // Find the Status field and Backlog option
          const statusField = project.fields.nodes.find(f => 
            f.name === 'Status' && f.options
          );
          
          if (!statusField) {
            console.log('⚠️  Status field not found, item added without specific status');
            return;
          }
          
          const backlogOption = statusField.options.find(o => 
            o.name === 'Backlog'
          );
          
          if (!backlogOption) {
            console.log('⚠️  Backlog status not found');
            console.log('Available statuses:', statusField.options.map(o => o.name));
            return;
          }
          
          // Set item status to Backlog
          const updateStatusMutation = `
            mutation($projectId: ID!, $itemId: ID!, $fieldId: ID!, $value: ProjectV2FieldValue!) {
              updateProjectV2ItemFieldValue(input: {
                projectId: $projectId
                itemId: $itemId
                fieldId: $fieldId
                value: $value
              }) {
                projectV2Item {
                  id
                }
              }
            }
          `;
          
          await github.graphql(updateStatusMutation, {
            projectId: project.id,
            itemId: itemId,
            fieldId: statusField.id,
       ...

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits October 24, 2025 12:49
…e README

Co-authored-by: kiyarose <75678535+kiyarose@users.noreply.github.com>
…nore

Co-authored-by: kiyarose <75678535+kiyarose@users.noreply.github.com>
Co-authored-by: kiyarose <75678535+kiyarose@users.noreply.github.com>
Copilot AI changed the title [WIP] Setup Actions marketplace for issue and PR automation Setup repository for GitHub Actions Marketplace with comprehensive automation suite Oct 24, 2025
Copilot AI requested a review from kiyarose October 24, 2025 12:57
kiyarose

This comment was marked as outdated.

Copy link
Contributor Author

Copilot AI commented Oct 24, 2025

@copilot
Error: Unable to resolve action sillylittletech/automationsuite@v1, unable to find version \v1``
my original raw workflow for reference....

The v1 tag doesn't exist yet because this PR hasn't been merged and released. To use the action now for testing, you have two options:

Option 1: Use the branch name (for testing before merge)

uses: SillyLittleTech/AutomationSuite@copilot/setup-actions-marketplace

Option 2: After PR is merged (recommended for production)

  1. Merge this PR to main
  2. Create and push the v1.0.0 tag:
    git tag -a v1.0.0 -m "Initial release"
    git push origin v1.0.0
  3. Create a major version tag pointing to v1.0.0:
    git tag -a v1 -m "Version 1"
    git push origin v1
  4. Then use: uses: SillyLittleTech/AutomationSuite@v1

For immediate testing with your current branch, use Option 1.

Copilot AI requested a review from kiyarose October 24, 2025 13:03
@kiyarose
Copy link
Member

@copilot for now can we push this pr as a pre-release tag so. we can get it working here for now, and then once the PR is merged I can make a full release, and update what I need.

Copy link
Contributor Author

Copilot AI commented Oct 24, 2025

@copilot for now can we push this pr as a pre-release tag so. we can get it working here for now, and then once the PR is merged I can make a full release, and update what I need.

I can't directly create or push tags, but you can create a pre-release tag yourself. Here's how:

On your local machine:

# Fetch the latest changes
git fetch origin

# Create a pre-release tag on the PR branch
git tag -a v1.0.0-beta.1 e822e7a -m "Pre-release for testing"

# Push the tag
git push origin v1.0.0-beta.1

# Optionally create a v1-beta tag for easier reference
git tag -a v1-beta e822e7a -m "Beta version 1"
git push origin v1-beta

Then use in your workflow:

uses: SillyLittleTech/AutomationSuite@v1-beta
# or
uses: SillyLittleTech/AutomationSuite@v1.0.0-beta.1

After the PR is merged, you can create the stable v1.0.0 and v1 tags pointing to the merge commit on main.

Copy link
Member

@kiyarose kiyarose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will go ahead and merge and tag

@kiyarose kiyarose marked this pull request as ready for review October 24, 2025 13:11
@kiyarose kiyarose merged commit fa09ab6 into main Oct 24, 2025
2 of 7 checks passed
@kiyarose kiyarose deleted the copilot/setup-actions-marketplace branch October 24, 2025 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments