Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b0994a7
added workflow to suggest which branches to target
Oct 27, 2025
5217f74
change working dir
Oct 27, 2025
b1e9a99
remove main ref
Oct 27, 2025
a121c50
added ref
Oct 27, 2025
b39f9dc
set env vars
Oct 27, 2025
30294fe
set proper name of jira token
Oct 27, 2025
54f704c
are debug lines
Oct 28, 2025
9823014
export vars
Oct 28, 2025
c923fd4
Remove node_modules and add .gitignore
Oct 28, 2025
d4c337d
Clean up unused scripts and add debug logging
Oct 28, 2025
426ddd6
standardize jira token ref
Oct 28, 2025
f9f3879
move to encoded jira token
Oct 28, 2025
632a3b8
run in debug mode
Oct 28, 2025
31e855e
run as remote to post a comment
Oct 28, 2025
7662a0d
change output format style
Oct 28, 2025
f176e59
change output format style
Oct 28, 2025
7af7f0e
fix comment body
Oct 28, 2025
eab54c1
chamge approach on how to load output
Oct 29, 2025
d74a0fa
chamge approach on how to load output
Oct 29, 2025
eeabfe3
chamge approach on how to load output
Oct 29, 2025
fd4f959
remove references to jira_email
Oct 29, 2025
e6be482
update instructions
Oct 29, 2025
7dfdfe9
support multiple components->versions
Oct 30, 2025
2c8ce80
when ticket id not found in branch name-> check pr title
Oct 30, 2025
c902eed
update doc
Oct 31, 2025
b14072c
improve documentation
Oct 31, 2025
85fc865
simplify comments
Nov 3, 2025
6a66619
minimize docs
Nov 3, 2025
a2e6903
update ref
Nov 3, 2025
b336fab
added tests for branch cuggestions
Nov 3, 2025
fc6a99d
update test dep
Nov 3, 2025
b991996
Update .github/workflows/branch-suggestion.yml
sredxny Nov 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/branch-suggestion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Branch Suggestion for PRs

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_call:
secrets:
JIRA_TOKEN:
required: true
description: 'Pre-encoded JIRA token (base64(email:api_token))'

permissions:
pull-requests: write
contents: read

jobs:
suggest-branches:
runs-on: ubuntu-latest

steps:
- name: Checkout github-actions repository
uses: actions/checkout@v4
with:
repository: TykTechnologies/github-actions
ref: main

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
working-directory: branch-suggestion
run: npm install

- name: Install Visor
run: npm install -g @probelabs/visor

- name: Analyze PR and suggest branches
working-directory: branch-suggestion
env:
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPOSITORY: ${{ github.repository }}
BRANCH_NAME: ${{ github.head_ref }}
run: |
visor --config branch_suggestion.yml --debug --tags remote
46 changes: 46 additions & 0 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI Tests

on:
push:
branches:
- main
- 'release-*'
pull_request:
paths:
- 'branch-suggestion/**'
- '.github/workflows/ci-test.yml'

defaults:
run:
working-directory: branch-suggestion

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: branch-suggestion/package-lock.json

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

- name: Generate coverage report
run: npm run test:coverage

- name: Upload coverage reports
uses: codecov/codecov-action@v4
if: always()
with:
files: ./branch-suggestion/coverage/coverage-final.json
flags: branch-suggestion
18 changes: 18 additions & 0 deletions .github/workflows/example-usage.yml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Branch Suggestion Workflow
# Documentation: https://github.com/TykTechnologies/github-actions/tree/main/branch-suggestion

name: PR Branch Suggestions

on:
pull_request:
types: [opened, synchronize, reopened]

permissions:
pull-requests: write
contents: read

jobs:
branch-suggestions:
uses: TykTechnologies/REFINE/.github/workflows/branch-suggestion.yml@main
secrets:
JIRA_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Node.js
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Environment files
.env
.env.local
.env.*.local

# OS files
.DS_Store
Thumbs.db

# IDE
.vscode/
.idea/
*.swp
*.swo
*~
3 changes: 3 additions & 0 deletions branch-suggestion/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage/
output/
debug-artifacts/
Loading
Loading