A GitHub Action that analyzes issues for sfops IssueOps operations. Parses issue body and labels to extract operation type, parameters, and metadata for workflow automation.
This action is designed for the IssueOps pattern used by sfops. It:
- Parses JSON payloads embedded in issue body comments (
<!-- {...} -->) - Extracts operation types from labels (e.g.,
sfops-deploy,issueops-provision) - Provides filtering via include/exclude issue ID lists
- Outputs structured data for downstream workflow steps
- name: Analyze Issue
uses: flxbl-io/analyze-issue@v1
id: analyze
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
- name: Process if sfops issue
if: steps.analyze.outputs.is-sfops-issue == 'true'
run: |
echo "Operation: ${{ steps.analyze.outputs.operation-type }}"
echo "Environments: ${{ steps.analyze.outputs.envs }}"
echo "Payload: ${{ steps.analyze.outputs.payload }}"The action expects issues to contain a JSON payload in an HTML comment:
## Deploy Request
Please deploy the following changes to production.
<!-- {"id": "deploy-prod", "envs": ["prod"], "packages": ["core", "ui"]} -->| Field | Type | Description |
|---|---|---|
id |
string | Unique identifier for the operation |
envs |
string[] | Target environments (defaults to ["devhub"]) |
operation / operationType / type |
string | Operation type (alternative to label-based detection) |
* |
any | Any additional fields are passed through in the payload |
| Input | Required | Default | Description |
|---|---|---|---|
gh-token |
Yes | - | GitHub token for authentication |
issue-number |
Yes | - | Issue number to analyze |
repository |
No | ${{ github.repository }} |
Repository in owner/repo format |
include-issues |
No | '' |
Comma-separated list of issue IDs to include |
exclude-issues |
No | '' |
Comma-separated list of issue IDs to exclude |
| Output | Description |
|---|---|
is-sfops-issue |
true if issue contains valid sfops payload |
payload |
JSON string of the complete enriched payload |
issue-number |
The analyzed issue number |
issue-creator |
GitHub username of the issue creator |
issue-id |
The id field from the payload |
envs |
JSON array of target environments |
operation-type |
Detected operation type |
labels |
JSON array of issue label names |
sfops-issue-* |
Dynamic outputs for each payload field |
name: Process IssueOps
on:
issues:
types: [opened, edited]
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- name: Analyze Issue
uses: flxbl-io/analyze-issue@v1
id: analyze
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
- name: Deploy
if: steps.analyze.outputs.is-sfops-issue == 'true' && steps.analyze.outputs.operation-type == 'deploy'
run: |
echo "Deploying to: ${{ steps.analyze.outputs.envs }}"- name: Analyze Issue
uses: flxbl-io/analyze-issue@v1
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
include-issues: 'deploy-prod,deploy-uat'
exclude-issues: 'deploy-dev'- name: Analyze Issue
uses: flxbl-io/analyze-issue@v1
id: analyze
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
- name: Access Custom Fields
if: steps.analyze.outputs.is-sfops-issue == 'true'
run: |
# Access standard outputs
echo "Creator: ${{ steps.analyze.outputs.issue-creator }}"
# Access dynamic outputs (for payload field "customField")
echo "Custom: ${{ steps.analyze.outputs.sfops-issue-customField }}"The action detects operation types in the following order:
operation,operationType, ortypefield in payload- Labels with
sfops-prefix (e.g.,sfops-deploy->deploy) - Labels with
issueops-prefix (e.g.,issueops-provision->provision) - Common operation labels:
deploy,release,provision,create,delete,update,refresh
- Node.js >= 20
- npm
npm installnpm run buildnpm test
npm run test:coveragenpm run lint
npm run formatCopyright 2025 flxbl-io. All rights reserved.
See LICENSE for details.