Skip to content

Merge pull request #106 from nyarla/dependabot-github_actions-shogo82… #176

Merge pull request #106 from nyarla/dependabot-github_actions-shogo82…

Merge pull request #106 from nyarla/dependabot-github_actions-shogo82… #176

---
name: Autoupdate cpanfile
on:
schedule:
- cron: '0 0 * * 6'
push:
paths:
- ".github/workflows/autoupdate-cpanfile.yml"
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
actions: write
steps:
# runner environment
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
ref: 'refs/heads/main'
- name: Install ubuntu dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libidn-dev
# perl environment
- uses: shogo82148/actions-setup-perl@98dfedee230bcf1ee68d5b021931fc8d63f2016e # v1.31.4
with:
perl-version: '5.38'
install-modules-with: carton
install-modules: App::UpdateCPANfile
- name: Update cpanfile
id: update-cpanfile
run: |
test ! -f cpanfile.snapshot || rm cpanfile.snapshot
carton install
{
echo "date=$(date +%Y-%m-%d)"
echo 'msg<<.....'
echo "### Update cpanfile at $(date +%Y-%m-%d)"
echo
carton exec update-cpanfile update | perl -lnpe 's<- ([a-zA-Z0-9:]+)><- [$1](https://metacpan.org/pod/$1) ==>'
echo
echo '---'
echo 'This pull request made by GitHub Actions'
echo
echo '.....'
} >> $GITHUB_OUTPUT
- uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
with:
title: 'Bump cpanfile at ${{ steps.update-cpanfile.outputs.date }}'
commit-message: 'chore(cpanfile): update cpanfile at ${{ steps.update-cpanfile.outputs.date }}'
body: ${{ steps.update-cpanfile.outputs.msg }}
branch: 'update-cpanfile-at-${{ steps.update-cpanfile.outputs.date }}'
add-paths: cpanfile