-
-
Notifications
You must be signed in to change notification settings - Fork 32
63 lines (52 loc) · 1.66 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
58
59
60
61
62
63
name: Update data and open pull request
on:
schedule:
- cron: '0 18 * * 2'
workflow_dispatch:
jobs:
update-definitions:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- id: is-scheduled
env:
EVENT_NAME: ${{ github.event_name }}
run: |
declare result
declare -i dom
dom="$(date +%d | sed 's/^0//')"
[[ "${EVENT_NAME}" == workflow_dispatch ]] && result=yes
((dom <= 7)) && result=yes
((dom >= 14 && dom <= 21)) && result=yes
echo "ok=${result}" >>"$GITHUB_OUTPUT"
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
persist-credentials: true
if: steps.is-scheduled.outputs.ok
- uses: ruby/setup-ruby@28c4deda893d5a96a6b2d958c5b47fc18d65c9d3 #v1.213.0
if: steps.is-scheduled.outputs.ok
with:
ruby-version: '3.2'
rubygems: 'latest'
bundler: 2
bundler-cache: true
- run: bundle exec rake release:gha
if: steps.is-scheduled.outputs.ok
- uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f #v7.0.6
if: steps.is-scheduled.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