diff --git a/.github/workflows/accessibility-alt-text-bot.yml b/.github/workflows/accessibility-alt-text-bot.yml index bba5c6afe..96af67f4b 100644 --- a/.github/workflows/accessibility-alt-text-bot.yml +++ b/.github/workflows/accessibility-alt-text-bot.yml @@ -1,5 +1,6 @@ jobs: accessibility_alt_text_bot: + if: ${{ !endsWith(github.actor, '[bot]') }} runs-on: ubuntu-latest steps: - uses: github/accessibility-alt-text-bot@v1.4.0 diff --git a/src/steps/writing/creation/dotGitHub/createWorkflowFile.ts b/src/steps/writing/creation/dotGitHub/createWorkflowFile.ts index e4dc32f72..534df93bb 100644 --- a/src/steps/writing/creation/dotGitHub/createWorkflowFile.ts +++ b/src/steps/writing/creation/dotGitHub/createWorkflowFile.ts @@ -49,6 +49,7 @@ interface WorkflowFileStep { interface WorkflowFileOptionsBase { concurrency?: WorkflowFileConcurrency; + if?: string; name: string; on?: WorkflowFileOn; permissions?: WorkflowFilePermissions; @@ -81,6 +82,7 @@ export function createWorkflowFile({ concurrency, jobs: { [name.replaceAll(" ", "_").toLowerCase()]: { + ...(options.if && { if: options.if }), "runs-on": "ubuntu-latest", steps: "runs" in options diff --git a/src/steps/writing/creation/dotGitHub/createWorkflows.test.ts b/src/steps/writing/creation/dotGitHub/createWorkflows.test.ts index 7f427262b..8e488e4c2 100644 --- a/src/steps/writing/creation/dotGitHub/createWorkflows.test.ts +++ b/src/steps/writing/creation/dotGitHub/createWorkflows.test.ts @@ -41,6 +41,7 @@ describe("createWorkflows", () => { { "accessibility-alt-text-bot.yml": "jobs: accessibility_alt_text_bot: + if: \${{ !endsWith(github.actor, '[bot]') }} runs-on: ubuntu-latest steps: - uses: github/accessibility-alt-text-bot@v1.4.0 @@ -351,6 +352,7 @@ describe("createWorkflows", () => { { "accessibility-alt-text-bot.yml": "jobs: accessibility_alt_text_bot: + if: \${{ !endsWith(github.actor, '[bot]') }} runs-on: ubuntu-latest steps: - uses: github/accessibility-alt-text-bot@v1.4.0 diff --git a/src/steps/writing/creation/dotGitHub/createWorkflows.ts b/src/steps/writing/creation/dotGitHub/createWorkflows.ts index f101c5ce1..f45e62c87 100644 --- a/src/steps/writing/creation/dotGitHub/createWorkflows.ts +++ b/src/steps/writing/creation/dotGitHub/createWorkflows.ts @@ -90,6 +90,7 @@ export function createWorkflows(options: Options) { }), }), "accessibility-alt-text-bot.yml": createWorkflowFile({ + if: "${{ !endsWith(github.actor, '[bot]') }}", name: "Accessibility Alt Text Bot", on: { issue_comment: {