Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
- on pull_request update
- from `/check` comment

## Tag

## Version

## Release (`release.yml`)
Expand Down
96 changes: 96 additions & 0 deletions .github/workflows/command-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: command merge

on:
repository_dispatch:
types: [merge-command]

permissions:
contents: write
pull-requests: write

jobs:
merge:
runs-on: ubuntu-latest
steps:
- name: Checkout target branch
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: refs/heads/${{ github.event.client_payload.pull_request.head.ref }}
token: ${{ secrets.REPOSITORY_WRITE_PAT }}

- name: Fail if not on release branch
if: (!startsWith(github.event.client_payload.pull_request.head.ref, 'release/v'))
run: |
echo "This command can only be run on release/v* branches."
exit 1

- name: Configure git for PAT
run: |
git config user.name "ReleaseBot"
git config user.email "[email protected]"
git remote set-url origin https://x-access-token:${{ secrets.REPOSITORY_WRITE_PAT }}@github.com/${{ github.repository }}.git

- name: Fetch main branch version.json
run: |
git fetch origin main
git checkout origin/main -- version.json

- name: Commit version.json from main
Comment thread
volllly marked this conversation as resolved.
run: |
git add version.json
if git diff-index --quiet HEAD -- version.json; then
echo "No changes to commit"
else
git commit -m "Update version.json from main before merge"
fi
git push origin HEAD

- name: Check PR status checks
run: |
gh auth login --with-token <<< "${{ secrets.REPOSITORY_WRITE_PAT }}"

# Verify all checks passed
STATUS=$(gh pr view ${{ github.event.client_payload.pull_request.number }} --json statusCheckRollup --jq '.statusCheckRollup[] | select(.conclusion != "SUCCESS" and .conclusion != "SKIPPED" and .conclusion != null) | .conclusion')

if [ ! -z "$STATUS" ]; then
echo "Not all status checks have passed. Cannot merge."
exit 1
fi

- name: Merge Pull Request
run: |
gh auth login --with-token <<< "${{ secrets.REPOSITORY_WRITE_PAT }}"
gh pr merge ${{ github.event.client_payload.pull_request.number }} --merge --auto

success:
needs:
- merge
runs-on: ubuntu-latest
if: success()
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:
- merge
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 }})
3 changes: 2 additions & 1 deletion .github/workflows/command-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
needs: [meta]
outputs:
version: ${{ steps.create-release.outputs.version }}
tag: ${{ steps.create-release.outputs.tag }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -129,7 +130,7 @@ jobs:
edit-mode: replace
body: |
/${{ github.event.client_payload.slash_command.command }} ${{ github.event.client_payload.slash_command.args.all }}
![](https://badgen.net/static/release%20${{ needs.release.outputs.version }}/success/green)
[![](https://badgen.net/static/release%20${{ needs.release.outputs.version }}/success/green)](${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ needs.release.outputs.tag }})

failure:
needs:
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/command-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ jobs:
secrets: inherit
with:
commit: ${{ github.event.client_payload.pull_request.head.sha }}

scu-at-build:
if: github.event.client_payload.slash_command.args.unnamed.arg1 == 'scu-at' && (github.event.client_payload.slash_command.args.unnamed.arg2 == 'ci' || github.event.client_payload.slash_command.args.unnamed.arg2 == 'build')
uses: ./.github/workflows/scu-at-build.yml
secrets: inherit
with:
commit: ${{ github.event.client_payload.pull_request.head.sha }}


scu-de-build:
if: github.event.client_payload.slash_command.args.unnamed.arg1 == 'scu-de' && (github.event.client_payload.slash_command.args.unnamed.arg2 == 'ci' || github.event.client_payload.slash_command.args.unnamed.arg2 == 'build')
uses: ./.github/workflows/scu-de-build.yml
Expand All @@ -46,7 +45,7 @@ jobs:
secrets: inherit
with:
commit: ${{ github.event.client_payload.pull_request.head.sha }}

scu-it-build:
if: github.event.client_payload.slash_command.args.unnamed.arg1 == 'scu-it' && (github.event.client_payload.slash_command.args.unnamed.arg2 == 'ci' || github.event.client_payload.slash_command.args.unnamed.arg2 == 'build')
uses: ./.github/workflows/scu-it-build.yml
Expand All @@ -72,9 +71,6 @@ jobs:
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
reactions: hooray
reactions-edit-mode: replace
edit-mode: replace
body: |
/${{ github.event.client_payload.slash_command.command }} ${{ github.event.client_payload.slash_command.args.all }}

failure:
needs:
Expand All @@ -93,4 +89,4 @@ jobs:
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 }}/failed/red)](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
[![](https://badgen.net/static/${{ github.event.client_payload.slash_command.command }}%20${{ github.run_id }}/failed/red)](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
4 changes: 0 additions & 4 deletions .github/workflows/command-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ jobs:
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
reactions: hooray
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${{ needs.version.outputs.new-version }}/success/green)](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})

failure:
needs:
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/manual-merging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Manual merging

on:
pull_request_target:
branches-ignore: "release/v*"

# This action will only run on non release branches
# We have setup this check as a requirement for merging
# That way release branches can not be manually merged because this check will always be in the waiting state
jobs:
noop:
runs-on: ubuntu-latest
steps:
- name: No-op step
run: echo 'No-op job'
59 changes: 41 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
name: 'Release'
name: "Release"
on:
push:
tags:
- queue/**/v*
- scu-at/**/v*
- scu-de/**/v*
- scu-es/**/v*
- scu-it/**/v*
release:
types: [published]

run-name: Release ${{ github.event.release.tag_name }}

permissions:
checks: write
Expand All @@ -15,33 +12,51 @@ permissions:
contents: read

jobs:
check-tag:
runs-on: ubuntu-latest
steps:
- name: Validate tag format
run: |
TAG="${{ github.event.release.tag_name }}"
if [[ "$TAG" =~ ^(queue|scu-at|scu-de|scu-es|scu-it)/.+/v.* ]]; then
echo "✅ Tag '$TAG' matches expected pattern"
else
echo "❌ Tag '$TAG' does not match expected pattern (queue|scu-at|scu-de|scu-es|scu-it)/<package>/v*"
exit 1
fi

test-queue:
if: startsWith(github.ref, 'refs/tags/queue/')
needs: [check-tag]
if: startsWith(github.event.release.tag_name, 'queue/')
uses: ./.github/workflows/queue-build.yml
secrets: inherit

test-scu-at:
if: startsWith(github.ref, 'refs/tags/scu-at/')
needs: [check-tag]
if: startsWith(github.event.release.tag_name, 'scu-at/')
uses: ./.github/workflows/scu-at-build.yml
secrets: inherit

test-scu-de:
if: startsWith(github.ref, 'refs/tags/scu-de/')
needs: [check-tag]
if: startsWith(github.event.release.tag_name, 'scu-de/')
uses: ./.github/workflows/scu-de-build.yml
secrets: inherit

test-scu-es:
if: startsWith(github.ref, 'refs/tags/scu-es/')
needs: [check-tag]
if: startsWith(github.event.release.tag_name, 'scu-es/')
uses: ./.github/workflows/scu-es-build.yml
secrets: inherit

test-scu-it:
if: startsWith(github.ref, 'refs/tags/scu-it/')
needs: [check-tag]
if: startsWith(github.event.release.tag_name, 'scu-it/')
uses: ./.github/workflows/scu-it-build.yml
secrets: inherit

meta:
needs: []
needs: [check-tag]
runs-on: windows-latest
outputs:
project: ${{ steps.meta.outputs.project }}
Expand All @@ -53,7 +68,7 @@ jobs:
- id: meta
shell: pwsh
run: |
if(!("${{ github.ref }}" -match "refs/tags/([a-z-]+)/([^/]+)/v.*")) {
if(!("${{ github.event.release.tag_name }}" -match "([a-z-]+)/([^/]+)/v.*")) {
throw "Invalid tag format"
}
$directory = $matches[1]
Expand All @@ -73,7 +88,7 @@ jobs:
Write-Output "project=$project" >> $env:GITHUB_OUTPUT

test-queue-acceptance:
if: startsWith(github.ref, 'refs/tags/queue/')
if: startsWith(github.event.release.tag_name, 'queue/')
concurrency:
group: queue-acceptance-tests
needs: [meta, test-queue]
Expand All @@ -82,9 +97,17 @@ jobs:
with:
only: fiskaltrust.Middleware.Storage.${{ needs.meta.outputs.package }}.AcceptanceTest


package:
needs: [meta, test-queue, test-queue-acceptance, test-scu-at, test-scu-de, test-scu-es, test-scu-it]
needs:
[
meta,
test-queue,
test-queue-acceptance,
test-scu-at,
test-scu-de,
test-scu-es,
test-scu-it,
]
if: (!failure())
secrets: inherit
uses: ./.github/workflows/package.yml
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/slash-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ jobs:
release
version
check
merge
Loading