-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (42 loc) · 1.28 KB
/
generate.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
on:
repository_dispatch:
types: [generate]
workflow_dispatch:
inputs:
ref:
description: Ref of aj-foster/open-api-generator
required: true
type: string
permissions:
contents: write
jobs:
generate:
name: Generate Code
runs-on: ubuntu-latest
steps:
- name: Setup Ref (Repository Dispatch)
if: github.event_name == 'repository_dispatch'
run: |
echo "REF=${{ github.event.client_payload.ref }}" >> $GITHUB_ENV"
- name: Setup Ref (Workflow Dispatch)
if: github.event_name == 'workflow_dispatch'
run: |
echo "REF=${{ inputs.ref }}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: Setup BEAM
uses: erlef/setup-beam@v1
with:
otp-version: "25.2"
elixir-version: "1.14.2"
- name: Generate Code
run: |
elixir generate.exs "$REF"
- name: Save Code
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add output/
git commit -m "Generated output for aj-foster/open-api-generator@$REF"
git tag -f "oapi_generator/$REF"
git push --tags --force