Skip to content

Commit

Permalink
ci: execute create GitHub release workflow when the publish package w…
Browse files Browse the repository at this point in the history
…orkflow completed (N8N-11)

This is required due to the limitation that changes from git users like github-actions[bot] and
dependabot[bot] do not trigger actions.
  • Loading branch information
MaSpeng authored and schroedan committed Jun 13, 2024
1 parent be39e50 commit 0ae38cf
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/create-github-release.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
name: Create GitHub Release

on:
push:
tags:
- 'barcode-*'
- 'channable-*'
- 'clockify-enhanced-*'
- 'cronhooks-*'
- 'fulfillmenttools-*'
- 'google-enhanced-*'
- 'kaufland-marketplace-*'
- 'moco-*'
- 'otto-market-*'
- 'sentry-io-enhanced-*'
workflow_run:
workflows:
- Create Tag and Publish Package
types:
- completed

permissions:
contents: write
Expand All @@ -22,24 +15,29 @@ env:

jobs:
create-release:
name: Create GitHub release
name: Create GitHub Release
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.ref }}
fetch-tags: true

- name: Get latest tag
id: latest_tag
run: echo "tag=$(git describe --tags --abbrev=0 ${{ github.ref }})" >> "$GITHUB_OUTPUT"

- name: Extract package name from tag
id: extract_package
# yamllint disable-line rule:line-length
run: echo "package=$(echo ${{ github.event.ref }} | sed -E 's#refs/tags/([^/]+)-[0-9]+\.[0-9]+\.[0-9]+.*#\1#')" >> "$GITHUB_OUTPUT"
run: echo "package=$(echo ${{ steps.latest_tag.outputs.tag }} | sed -E 's#([^/]+)-[0-9]+\.[0-9]+\.[0-9]+.*#\1#')" >> "$GITHUB_OUTPUT"

- name: Extract version from tag
id: extract_version
# yamllint disable-line rule:line-length
run: echo "version=$(echo ${{ github.event.ref }} | sed -E 's#refs/tags/[^/]+-([0-9]+\.[0-9]+\.[0-9]+.*)#\1#')" >> "$GITHUB_OUTPUT"
run: echo "version=$(echo ${{ steps.latest_tag.outputs.tag }} | sed -E 's#[^/]+-([0-9]+\.[0-9]+\.[0-9]+.*)#\1#')" >> "$GITHUB_OUTPUT"

- name: Extract Changelog
id: changelog
Expand Down

0 comments on commit 0ae38cf

Please sign in to comment.