Update data and open pull request #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected] | |
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 |