Skip to content

Publish — Validate Scheduled #44

Publish — Validate Scheduled

Publish — Validate Scheduled #44

name: Publish to PSGallery
run-name: >-
Publish
${{ github.event_name == 'push' && format('— {0}', github.event.head_commit.message)
|| github.event_name == 'pull_request' && format('PR #{0}: {1}', github.event.pull_request.number, github.event.pull_request.title)
|| github.event_name == 'schedule' && 'Scheduled'
|| github.event_name == 'workflow_dispatch' && 'Manual Dispatch'
|| github.event_name == 'workflow_run' && format('— {0}', github.event.workflow_run.display_title)
|| format('CI Run for commit {0}', github.sha)
}}
on:
workflow_run:
workflows: ["PowerShell CI"]
types:
- completed
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
publish:
if: >-
${{
github.event.workflow_run.conclusion == 'success'
&& github.event.workflow_run.head_branch == 'main'
&& github.event.workflow_run.event == 'push'
}}
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# Runs a single command using the runners shell
- name: Publish Module to PowerShell Gallery
#formerly pcgeek86/publish-powershell-module-action@v20
uses: Pxtl/[email protected]
id: publish-modules
with:
NuGetApiKey: ${{ secrets.PS_GALLERY_KEY }}
continueIfAlreadyPublished: true