-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (45 loc) · 1.67 KB
/
generate-module.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Generate module
# This workflow is triggered after standalone generator is built using an external event
on: repository_dispatch
# you could also trigger it on pushes to the repository
#on:
# push:
# branches-ignore:
# - generator-update
# you could also just run it regularly
#on:
# schedule:
# - cron: '0 */12 * * *' # run every 12 hours
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout sources from main branch
uses: actions/checkout@v4
with:
ref: main
# see https://github.com/Guite/generator-action/
- name: Call standalone generator
uses: docker://guite/generator-action:latest
with:
args: MultiHook.mostapp Zikula/MultiHookModule "src/" true
- name: Set output variables
id: vars
run: |
echo ::set-output name=pr_title::"⬆️ generator update $(date +%d-%m-%Y)"
echo ::set-output name=pr_body::"This PR was auto-generated on $(date +%d-%m-%Y) \
with latest generator using [generator-action](https://github.com/Guite/generator-action/) :tada:"
# see https://github.com/peter-evans/create-pull-request
- name: Commit changes and create/update pull request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: '⬆️ update generated code'
title: ${{ steps.vars.outputs.pr_title }}
body: ${{ steps.vars.outputs.pr_body }}
branch: generator-update
- name: Check outputs
run: |
echo "Pull Request Number: ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL: ${{ steps.cpr.outputs.pull-request-url }}"