Skip to content

Commit

Permalink
add workflow for updating rds bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
coreypurcell committed Oct 29, 2024
1 parent 5783c7b commit 002650b
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/update-rds-ca-bundle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Update RDS CA Bundle
on:
workflow_dispatch:
schedule:
- cron: '0,15,30,45 * * * 1-5'

permissions:
actions: write
contents: write
pull-requests: write

jobs:
update-rds-ca-inventory:
name: Update RDS CA Bundle
runs-on: pub-hk-ubuntu-24.04-ip
steps:
# - uses: actions/create-github-app-token@v1
# id: generate-token
# with:
# app-id: ${{ vars.LINGUIST_GH_APP_ID }}
# private-key: ${{ secrets.LINGUIST_GH_PRIVATE_KEY }}

- name: Checkout Repo
uses: actions/checkout@v4

- name: Compare
id: compare
run: |
wget -q https://truststore.pki.rds.amazonaws.com/us-east-1/us-east-1-bundle.pem -O /tmp/global-bundle.pem
if cmp —silent — /tmp/global-bundle.pem heroku-24/rds-global-bundle.pem; then
echo "files_match=true" >> $GITHUB_OUTPUT
else
echo "files_match=false" >> $GITHUB_OUTPUT
cp /tmp/global-bundle.pem heroku-24/rds-global-bundle.pem
cp /tmp/global-bundle.pem heroku-22/rds-global-bundle.pem
cp /tmp/global-bundle.pem heroku-20/rds-global-bundle.pem
fi
# - name: Update Changelog
# run: echo "${{ steps.rebuild-inventory.outputs.msg }}" | xargs -r -I '{}' perl -i -p -e 's/\[Unreleased\]\s+/[Unreleased]\n\n- {}/' buildpacks/go/CHANGELOG.md

- name: Create Pull Request
if: steps.compare.outputs.files_match == 'false'
id: pr
uses: peter-evans/create-pull-request@v7
with:
# token: ${{ steps.generate-token.outputs.token }}
title: "Update RDS CA Bundle"
commit-message: "Update RDS CA Bundle to latest version"
# committer: ${{ vars.LINGUIST_GH_APP_USERNAME }} <${{ vars.LINGUIST_GH_APP_EMAIL }}>
# author: ${{ vars.LINGUIST_GH_APP_USERNAME }} <${{ vars.LINGUIST_GH_APP_EMAIL }}>
branch: update-rds-ca-bundle
body: "Automated pull-request to update the RDS CA bundle"

- name: Configure PR
if: steps.pr.outputs.pull-request-operation == 'created'
env:
GH_TOKEN: ${{ github.token }}
# GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: gh pr merge --squash --auto "${{ steps.pr.outputs.pull-request-number }}"

0 comments on commit 002650b

Please sign in to comment.