Skip to content

Commit

Permalink
Create an issue when the data is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
briandfoy committed Mar 18, 2023
1 parent 73959b7 commit e99bd3e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/new_range_message_template.md
@@ -0,0 +1,6 @@
---
title: New RangeMessage.xml for {{ env.NEW_VERSION }}
assignees: briandfoy
tag: 'Type: data update'
---
The RangeMessage.xml was updated from {{ env.OLD_VERSION }}
15 changes: 14 additions & 1 deletion .github/workflows/update_range_message.yml
Expand Up @@ -3,11 +3,15 @@ on:
schedule:
- cron: "37 3 * * *"
workflow_dispatch:
permissions:
contents: read
issues: write
jobs:
update-ranges:
runs-on: ubuntu-latest
env:
RANGE_MESSAGES_SAME: 1
CHANGES_PUSHED: 0
steps:
- uses: actions/checkout@v3
- name: setup packages
Expand Down Expand Up @@ -36,7 +40,9 @@ jobs:
if: ${{ env.RANGE_MESSAGES_SAME == 0 }}
run: |
mv lib/Business/ISBN/RangeMessage.xml.new lib/Business/ISBN/RangeMessage.xml
perl -000 -le 'm/^our \x24VERSION=\x27(.+?)\x27/m and print qq(OLD_VERSION=$1)' lib/Business/ISBN/Data.pm >> $GITHUB_ENV
perl -Ilib examples/make_default_data.pl
perl -000 -le 'm/^our \x24VERSION=\x27(.+?)\x27/m and print qq(NEW_VERSION=$1)' lib/Business/ISBN/Data.pm >> $GITHUB_ENV
perl Makefile.PL
make test
- name: Commit RangeMessage.xml
Expand All @@ -46,5 +52,12 @@ jobs:
run: |
git diff
git add lib/Business/ISBN/RangeMessage.xml lib/Business/ISBN/Data.pm
git commit -m "Latest RangeMessage.xml" lib/Business/ISBN/RangeMessage.xml lib/Business/ISBN/Data.pm
git commit -m "RangeMessage.xml for {{ env.NEW_VERSION }}" lib/Business/ISBN/RangeMessage.xml lib/Business/ISBN/Data.pm
git push origin master
echo "CHANGES_PUSHED=1" >> $GITHUB_ENV
- uses: JasonEtco/create-an-issue@v2
id: create-issue
env:
GITHUB_TOKEN: ${{ secrets.ISSUES_GITHUB_TOKEN }}
with:
filename: .github/new_range_message_template.md

0 comments on commit e99bd3e

Please sign in to comment.