From cfa9226d41a9b7152fb077bf4ecb4880c0221428 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 26 Aug 2023 09:15:25 -0400 Subject: [PATCH] Added a cron job to send PRs updating cert bundle --- .github/workflows/bump.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/bump.yml diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml new file mode 100644 index 00000000..55c7e1a8 --- /dev/null +++ b/.github/workflows/bump.yml @@ -0,0 +1,31 @@ +name: Bump cacert.pem + +on: + workflow_dispatch: + schedule: + # Run daily + - cron: "0 0 * * *" + +jobs: + bump: + if: github.repository_owner == 'pyca' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 + - run: make update + - name: Update date + id: update-date + run: | + if $(git diff --quiet certifi/cacert.pem)); then + DATE=$(date +"%Y.%m.%d") + sed -E -i "s/__version__ = .*/__version__ = \"${DATE}\"/" certifi/__init__.py + echo "DATE=${DATE}" >> $GITHUB_OUTPUT + fi + + - name: Create Pull Request + uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2 + with: + commit-message: "${{ steps.update-date.outputs.DATE }}" + title: "${{ steps.update-date.outputs.DATE }}" + token: ${{ secrets.GITHUB_TOKEN }} + if: steps.update-date.outputs.DATE