Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
45 changes: 14 additions & 31 deletions label-dispatcher/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ inputs:
description: 'Path to workflow configuration file'
required: false
default: 'workflow-config.yaml'
deploy-actions-repository:
description: 'Deploy actions repository to use'
required: false
default: 'panicboat/deploy-actions'
deploy-actions-ref:
description: 'Ref (branch, tag, or SHA) of deploy-actions to checkout'
required: false
default: ''

outputs:
labels-added:
Expand All @@ -46,13 +38,6 @@ outputs:
runs:
using: 'composite'
steps:
- name: Checkout deploy-actions
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: ${{ inputs.deploy-actions-repository }}
ref: ${{ inputs.deploy-actions-ref || github.action_ref }}
path: deploy-actions

- name: Checkout source repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -66,42 +51,40 @@ runs:
with:
ruby-version: '4.0.7'
bundler-cache: true
working-directory: deploy-actions/action-scripts

- name: Copy configuration from source repository
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const path = require('path');
const copyConfiguration = require(path.join(process.env.GITHUB_ACTION_PATH, 'copy-configuration.js'));
await copyConfiguration({ core, inputs: ${{ toJSON(inputs) }} });
working-directory: ${{ github.action_path }}/../action-scripts

- name: Validate configuration
shell: bash
working-directory: deploy-actions/action-scripts
working-directory: ${{ github.action_path }}/../action-scripts
run: |
echo "🔍 Validating configuration file"
bundle exec ruby config-manager/bin/config-manager validate
env:
WORKFLOW_CONFIG_PATH: workflow-config.yaml
WORKFLOW_CONFIG_PATH: ${{ github.workspace }}/source-repo/${{ inputs.config-path }}
SOURCE_REPO_PATH: ${{ github.workspace }}/source-repo

- name: Dispatch labels
id: dispatch
shell: bash
working-directory: deploy-actions/action-scripts
working-directory: ${{ github.action_path }}/../action-scripts
run: |
echo "🚀 Starting label dispatch for PR #${{ inputs.pr-number }}"
bundle exec ruby label-dispatcher/bin/dispatcher dispatch ${{ inputs.pr-number }}
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
GITHUB_REPOSITORY: ${{ inputs.repository }}
WORKFLOW_CONFIG_PATH: workflow-config.yaml
WORKFLOW_CONFIG_PATH: ${{ github.workspace }}/source-repo/${{ inputs.config-path }}
SOURCE_REPO_PATH: ${{ github.workspace }}/source-repo

- name: Report results
if: always()
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
REPOSITORY: ${{ inputs.repository }}
PR_NUMBER: ${{ inputs.pr-number }}
with:
script: |
const path = require('path');
const reportResults = require(path.join(process.env.GITHUB_ACTION_PATH, 'report-results.js'));
await reportResults({ core, context, inputs: ${{ toJSON(inputs) }} });
core.info('📊 Label dispatch completed');
core.info(`Repository: ${process.env.REPOSITORY}`);
core.info(`PR Number: ${process.env.PR_NUMBER}`);
core.info(`Status: ${context.job.status || 'unknown'}`);
30 changes: 0 additions & 30 deletions label-dispatcher/copy-configuration.js

This file was deleted.

12 changes: 0 additions & 12 deletions label-dispatcher/report-results.js

This file was deleted.

71 changes: 18 additions & 53 deletions label-resolver/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ inputs:
description: 'Path to workflow configuration file'
required: false
default: 'workflow-config.yaml'
deploy-actions-repository:
description: 'Deploy actions repository to use'
required: false
default: 'panicboat/deploy-actions'
deploy-actions-ref:
description: 'Ref (branch, tag, or SHA) of deploy-actions to checkout'
required: false
default: ''

outputs:
targets:
Expand All @@ -46,13 +38,6 @@ outputs:
runs:
using: 'composite'
steps:
- name: Checkout deploy-actions
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: ${{ inputs.deploy-actions-repository }}
ref: ${{ inputs.deploy-actions-ref || github.action_ref }}
path: deploy-actions

- name: Checkout source repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -65,29 +50,22 @@ runs:
with:
ruby-version: '4.0.7'
bundler-cache: true
working-directory: deploy-actions/action-scripts

- name: Copy configuration from source repository
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const path = require('path');
const copyConfiguration = require(path.join(process.env.GITHUB_ACTION_PATH, 'copy-configuration.js'));
await copyConfiguration({ core, inputs: ${{ toJSON(inputs) }} });
working-directory: ${{ github.action_path }}/../action-scripts

- name: Validate configuration
shell: bash
working-directory: deploy-actions/action-scripts
working-directory: ${{ github.action_path }}/../action-scripts
run: |
echo "🔍 Validating configuration file"
bundle exec ruby config-manager/bin/config-manager validate
env:
WORKFLOW_CONFIG_PATH: workflow-config.yaml
WORKFLOW_CONFIG_PATH: ${{ github.workspace }}/source-repo/${{ inputs.config-path }}
SOURCE_REPO_PATH: ${{ github.workspace }}/source-repo

- name: Resolve deployment targets
id: extract
shell: bash
working-directory: deploy-actions/action-scripts
working-directory: ${{ github.action_path }}/../action-scripts
run: |
echo "🚀 Starting deployment target resolution"
echo "PR: ${{ inputs.pr-number }}"
Expand All @@ -96,38 +74,25 @@ runs:
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
GITHUB_REPOSITORY: ${{ inputs.repository }}
WORKFLOW_CONFIG_PATH: workflow-config.yaml
WORKFLOW_CONFIG_PATH: ${{ github.workspace }}/source-repo/${{ inputs.config-path }}
SOURCE_REPO_PATH: ${{ github.workspace }}/source-repo

- name: Parse deployment outputs
id: parse
- name: Report results
if: always()
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
REPOSITORY: ${{ inputs.repository }}
PR_NUMBER: ${{ inputs.pr-number }}
TARGET_ENVIRONMENTS: ${{ inputs.environments }}
DEPLOYMENT_TARGETS: ${{ steps.extract.outputs.targets }}
HAS_TARGETS: ${{ steps.extract.outputs.has-targets }}
SAFETY_STATUS: ${{ steps.extract.outputs.safety-status }}
with:
script: |
const path = require('path');
const parseOutputs = require(path.join(process.env.GITHUB_ACTION_PATH, 'parse-deployment-outputs.js'));
await parseOutputs({ core, context });

- name: Report results
if: always()
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const path = require('path');
const reportResults = require(path.join(process.env.GITHUB_ACTION_PATH, 'report-results.js'));
await reportResults({
core,
inputs: ${{ toJSON(inputs) }},
steps: {
extract: {
outputs: {
'has-targets': '${{ steps.extract.outputs.has-targets }}',
'safety-status': '${{ steps.extract.outputs.safety-status }}'
}
}
}
});
core.info('📊 Label Resolver completed');
core.info(`Repository: ${process.env.REPOSITORY}`);
core.info(`PR Number: ${process.env.PR_NUMBER}`);
core.info(`Target Environments: ${process.env.TARGET_ENVIRONMENTS || 'all'}`);
core.info(`Deployment Targets: ${process.env.DEPLOYMENT_TARGETS || '[]'}`);
core.info(`Has Targets: ${process.env.HAS_TARGETS || 'false'}`);
core.info(`Safety Status: ${process.env.SAFETY_STATUS || 'unknown'}`);
30 changes: 0 additions & 30 deletions label-resolver/copy-configuration.js

This file was deleted.

17 changes: 0 additions & 17 deletions label-resolver/parse-deployment-outputs.js

This file was deleted.

14 changes: 0 additions & 14 deletions label-resolver/report-results.js

This file was deleted.

Loading