Skip to content

add log

add log #115

Workflow file for this run

name: command release

Check failure on line 1 in .github/workflows/command-release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/command-release.yml

Invalid workflow file

(Line: 102, Col: 9): Job 'success' depends on unknown job 'tag'., (Line: 116, Col: 9): Job 'failure' depends on unknown job 'tag'.
on:
repository_dispatch:
types: [release-command]
permissions:
pull-requests: write
checks: write
id-token: write
contents: write
jobs:
meta:
needs: []
runs-on: windows-latest
outputs:
project: ${{ steps.meta.outputs.project }}
package: ${{ steps.meta.outputs.package }}
directory: ${{ steps.meta.outputs.directory }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.client_payload.pull_request.head.ref }}
- id: meta
shell: pwsh
run: |
$directory = "${{ github.event.client_payload.slash_command.args.unnamed.arg1 }}"
$package = "${{ github.event.client_payload.slash_command.args.unnamed.arg2 }}"
Write-Output "package=$package"
Write-Output "package=$package" >> $env:GITHUB_OUTPUT
Write-Output "directory=$directory/src"
Write-Output "directory=$directory/src" >> $env:GITHUB_OUTPUT
$prefix = ""
if($directory -eq "queue") {
$prefix = "fiskaltrust.Middleware.Queue"
} elseif($directory -match "scu-([a-z]{2})") {
$prefix = "fiskaltrust.Middleware.SCU.$($matches[1].ToUpper())"
}
$project = $(Get-Item "$directory/src/$prefix.$package").Name
Write-Output "project=$project"
Write-Output "project=$project" >> $env:GITHUB_OUTPUT
release:
runs-on: ubuntu-latest
needs: [meta]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.client_payload.pull_request.head.ref }}
fetch-depth: 0
token: ${{ secrets.REPOSITORY_WRITE_PAT }}
- name: Install nbgv
run: dotnet tool update -g nbgv
- name: Configure git for PAT
run: |
git config user.name "ReleaseBot"
git config user.email "dev-portal-poscreator@fiskaltrust.de"
git remote set-url origin https://x-access-token:${{ secrets.REPOSITORY_WRITE_PAT }}@github.com/${{ github.repository }}.git
- name: Get Release Data
if: startsWith(github.event.client_payload.pull_request.head.ref, 'release/')
run: |
output=(nbgv tag --project ${{ needs.meta.outputs.directory }}/${{ needs.meta.outputs.project }})
tag=$(echo "$output" | head -n1 | awk '{print $1}')
version="${tag##*/v}"
releaseName=$(echo "${{ needs.meta.outputs.project }}" | awk -F. '{print $(NF-1)"."$NF}') v$version"
if [[ "$version" == *-* ]]; then
preRelease=true
releaseBody=""
else
preRelease=false
releaseBody="Release notes: https://docs.fiskaltrust.cloud/changelog/middleware/$version"
fi
echo "tag=$tag"
echo "tag=$tag" >> $GITHUB_ENV
echo "releaseName=$releaseName"
echo "releaseName=$releaseName" >> $GITHUB_ENV
echo "preRelease=$preRelease"
echo "preRelease=$preRelease" >> $GITHUB_ENV
echo "releaseBody=$releaseBody"
echo "releaseBody=$releaseBody" >> $GITHUB_ENV
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.tag }}
name: ${{ env.releaseName }}
body: ${{ env.releaseBody }}
prerelease: $ {{env.preRelease}}
env:
GITHUB_TOKEN: ${{ secrets.REPOSITORY_WRITE_PAT }}
success:
needs:
- tag
runs-on: ubuntu-latest
if: success('tag')
steps:
- name: Add reaction
uses: peter-evans/create-or-update-comment@v4
with:
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
reactions: hooray
reactions-edit-mode: replace
failure:
needs:
- tag
runs-on: ubuntu-latest
if: failure()
steps:
- name: Add reaction
uses: peter-evans/create-or-update-comment@v4
with:
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
reactions: confused
reactions-edit-mode: replace
edit-mode: replace
body: |
/${{ github.event.client_payload.slash_command.command }} ${{ github.event.client_payload.slash_command.args.all }}
[![](https://badgen.net/static/${{ github.event.client_payload.slash_command.command }}%20${{ github.run_id }}/failure/red)](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})