-
-
Notifications
You must be signed in to change notification settings - Fork 31
57 lines (47 loc) · 1.37 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
50
51
52
53
54
55
56
57
name: Update data and open pull request
on:
schedule:
- cron: '0 18 * * 2'
workflow_dispatch:
jobs:
generate:
runs-on: ubuntu-latest
steps:
- id: is-first-week
env:
EVENT_NAME: ${{ github.event_name }}
run: |
declare result
declare -i dom
dom="$(date +%d | sed 's/^0//')"
if ((dom <= 7)) || [[ "${EVENT_NAME}" == workflow_dispatch ]]; then
result=yes
fi
echo "ok=${result}" >>"$GITHUB_OUTPUT"
- uses: actions/checkout@v4
if: steps.is-first-week.outputs.ok
- uses: ruby/setup-ruby@v1
if: steps.is-first-week.outputs.ok
with:
ruby-version: '3.2'
rubygems: 'latest'
bundler: 2
bundler-cache: true
- run: bundle exec rake release:gha
if: steps.is-first-week.outputs.ok
- uses: peter-evans/create-pull-request@v7.0.5
if: steps.is-first-week.outputs.ok
with:
commit-message: |
${{ env.UPDATE_TITLE }}
${{ env.UPDATE_BODY }}
branch: update-mime-types-data/${{ env.UPDATE_VERSION }}
title: ${{ env.UPDATE_TITLE }}
body: ${{ env.UPDATE_BODY }}
labels: |
automated
data-update
assignees: |
halostatue
reviewers: |
halostatue