Skip to content

Add test workflow

Add test workflow #9

Workflow file for this run

name: Debug Test 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:
debug_issue_mover:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- 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 debugging',
body: 'This is a test issue created to debug the issue mover action.',
labels: ['test-label']
});
console.log('Test issue created:', issue.data.html_url);
return issue.data;
- name: Debug Environment
run: |
echo "GitHub Event Name: ${{ github.event_name }}"
echo "GitHub Event Action: ${{ github.event.action }}"
echo "Issue Number: ${{ steps.create_issue.outputs.result.number }}"
echo "Issue Node ID: ${{ steps.create_issue.outputs.result.node_id }}"
- name: Debug GitHub Context
uses: actions/github-script@v7
with:
script: |
console.log('GitHub Context:', JSON.stringify(context, null, 2));
console.log('GitHub Event:', JSON.stringify(github.event, null, 2));
- name: Run issue mover action with debug
uses: ./
env:
GITHUB_EVENT_PATH: ${{ toJson(github.event) }}
ACTIONS_STEP_DEBUG: true
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 = ${{ 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');