Skip to content

Commit

Permalink
feat: Add "control-instance-from-workflow" to enable reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfr committed Aug 24, 2024
1 parent e25ff72 commit 2cca2ed
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/control-instance-from-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Control Instance from Workflow

on:
workflow_dispatch:
inputs:
issue_number:
description: "Issue number"
required: true
type: number
command_name:
description:
"Name of the command to execute: create, delete, shelve, unshelve"
required: true
type: string
workflow_call:
inputs:
issue_number:
description: "Issue number"
required: true
type: number
command_name:
description:
"Name of the command to execute: create, delete, shelve, unshelve"
required: true
type: string
permissions:
issues: write
checks: read

jobs:
control:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4

- name: Control instance
run: |
gh issue comment $ISSUE_NUMBER \
-b "Command `shelve` issued by *control-instance-from-workflow.yml* workflow<br>\
<br>\
For details, see https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}_"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
GH_REPO: ${{ github.repository }}
ISSUE_NUMBER: ${{ inputs.issue_number }}

- name: Control instance
uses: ./.github/actions/control-instance
with:
issue_number: ${{ inputs.issue_number }}
command_name: ${{ inputs.command_name }}
instance_name_prefix: ${{ vars.INSTANCE_NAME_PREFIX }}

0 comments on commit 2cca2ed

Please sign in to comment.