Skip to content

Add test workflow

Add test workflow #6

Workflow file for this run

name: Test and Use Move Issue Action
on:
pull_request:
types: [opened, synchronize, reopened]
issues:
types: [labeled]
workflow_dispatch:
env:
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
PROJECT_URL: ${{ secrets.PROJECT_URL }}
jobs:
test_issue_mover:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create test issue
id: create_issue
uses: actions/github-script@v7
with:
github-token: ${{ env.PAT_TOKEN }}
script: |
const issue = await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'Test issue for PR #' + context.issue.number,
body: 'This is a test issue created to verify the issue mover action.',
labels: ['test-label']
});
console.log('Test issue created:', issue.data.html_url);
return JSON.stringify(issue.data);
- name: Run issue mover action
uses: ./
with:
github-token: ${{ env.PAT_TOKEN }}
project-url: ${{ env.PROJECT_URL }}
target-labels: "test-label"
target-column: "In Progress"
ignored-columns: "Done"
- name: Clean up test issue
if: always()
uses: actions/github-script@v7
with:
github-token: ${{ env.PAT_TOKEN }}
script: |
const issueData = JSON.parse('${{ steps.create_issue.outputs.result }}');
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueData.number,
state: 'closed'
});
console.log('Test issue closed');
move_labeled_issues:
runs-on: ubuntu-latest
if: github.event_name == 'issues'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Move issues to project column
uses: ./
with:
github-token: ${{ env.PAT_TOKEN }}
project-url: ${{ env.PROJECT_URL }}
target-labels: "Size: Small,Size: Medium,Size: Large"
target-column: "In Progress"
ignored-columns: "Done"