mirror of
https://github.com/actions/versions-package-tools.git
synced 2025-12-26 19:47:24 +08:00
Introduce reusable workflows into versions repositories (#60)
This commit is contained in:
51
.github/workflows/validate-manifest.yml
vendored
Normal file
51
.github/workflows/validate-manifest.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
# This reusable workflow is used by actions/*-versions repositories
|
||||
# It is designed to validate the versions-manifest.json file
|
||||
# The 'SLACK_CHANNEL_URL' secret must be added to the repository containing the caller workflow
|
||||
# in order to publish messages to Slack
|
||||
|
||||
name: Validate manifest
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
tool-name:
|
||||
description: 'Name of the tool for which manifest is validated'
|
||||
required: true
|
||||
type: string
|
||||
image-url:
|
||||
description: 'Tool image to be attached to Slack posts'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: pwsh
|
||||
|
||||
jobs:
|
||||
validation:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Validate manifest
|
||||
run: .\helpers\packages-generation\manifest-validator.ps1 -ManifestPath '.\versions-manifest.json'
|
||||
|
||||
check_build:
|
||||
name: Check validation for failures
|
||||
runs-on: ubuntu-latest
|
||||
needs: [validation]
|
||||
if: failure()
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Send Slack notification if validation fails
|
||||
run: |
|
||||
$pipelineUrl = "$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID"
|
||||
$message = "The validation of ${{ inputs.tool-name }} manifest failed. \nLink to the pipeline: $pipelineUrl"
|
||||
.\helpers\get-new-tool-versions\send-slack-notification.ps1 -Url "${{ secrets.SLACK_CHANNEL_URL }}" `
|
||||
-ToolName "${{ inputs.tool-name }}" `
|
||||
-Text "$message" `
|
||||
-ImageUrl "${{ inputs.image-url }}"
|
||||
Reference in New Issue
Block a user