-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (48 loc) · 1.61 KB
/
report.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
name: report
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * 1"
push:
branches:
- main
- 8.x
jobs:
generate_report:
runs-on: ubuntu-latest
env:
STACK_VERSION: 9.1.0-SNAPSHOT
BRANCH: 'main' # Branch for downloading the specs
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{ env.BRANCH }}
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- name: Build
run: |
cd report && bundle install
echo "REPORT_DATE=`date "+%Y-%m-%d|%H:%M:%S"`" >> $GITHUB_ENV
- name: Download Artifacts
run: cd report && bundle exec rake download_all
- name: Generate report
run: cd report && bundle exec rake report
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
id: cpr
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Updates API report ${{env.REPORT_DATE}} ${{ env.BRANCH }}
branch: update_report_${{ env.BRANCH }}
title: Updates API report ${{ env.BRANCH }}
body: 'As titled'
base: ${{ env.BRANCH }}
committer: 'Elastic Machine <elasticmachine@users.noreply.github.com>'
author: 'Elastic Machine <elasticmachine@users.noreply.github.com>'
- name: Pull Request Summary
if: ${{ steps.cpr.outputs.pull-request-url }}
run: |
echo "${{ env.BRANCH }} - ${{ steps.cpr.outputs.pull-request-url }}" >> $GITHUB_STEP_SUMMARY