-
Notifications
You must be signed in to change notification settings - Fork 19
47 lines (44 loc) · 1.56 KB
/
generator.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
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
get_latest_commit_author:
runs-on: ubuntu-latest
outputs:
latest-commit-author: ${{ steps.commit_author.outputs.author }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- id: commit_author
run: echo "name=author::$(git show -s --format=%an)" >> $GITHUB_OUTPUT
generator:
needs: get_latest_commit_author
if: needs.get_latest_commit_author.outputs.latest-commit-author != 'github-actions[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
token: ${{ secrets.PAT || github.token }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- uses: actions/setup-node@v4
with:
node-version: 18
- run: bin/generate_files
- run: git diff --exit-code
- if: failure() && github.event.pull_request.head.repo.full_name == 'mtsmfm/language_server-protocol-ruby'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add lib
git commit -m "$ bin/generate_files"
git push origin HEAD:${{ github.head_ref }}