Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion .github/workflows/update-geolite-database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ jobs:
git config --global user.email '${{ github.actor }}@users.noreply.github.com'
git config --global user.name '${{ github.actor }}'

- name: Close obsolete GeoLite update PRs
run: |
gh pr list \
--search '"Update GeoLite Database" in:title base:release-ulmo' \
Comment thread
ktyagiapphelix2u marked this conversation as resolved.
Outdated
--state open \
Comment thread
ktyagiapphelix2u marked this conversation as resolved.
--json number \
--jq '.[].number' | \
xargs -r -I{} gh pr close {} \
--comment 'Superseded by a newer automated GeoLite database update. Please review the latest PR.'
Comment thread
ktyagiapphelix2u marked this conversation as resolved.
env:
GH_TOKEN: ${{ secrets.GH_PAT_WITH_ORG }}

- name: Create a branch, commit the code and make a PR
id: create-pr
run: |
Expand All @@ -75,9 +87,20 @@ jobs:
git status
git commit -m "chore: geoip2: update maxmind geolite country database"
git push --set-upstream origin $BRANCH
cat > /tmp/pr_body.md <<'EOF'
PR generated by workflow `${{ github.workflow }}` on behalf of @${{ github.actor }}.

## Runbook
See: https://2u-internal.atlassian.net/wiki/spaces/AT/pages/3420061706/Runbook+GeoLite2+Country+Database+Update

## Actions Required
- [ ] Verify that only `common/static/data/geoip/GeoLite2-Country.mmdb` changed
- [ ] Wait for CI to pass
- [ ] Merge this PR
EOF
PR_URL=$(gh pr create \
--title "Update GeoLite Database" \
--body "PR generated by workflow `${{ github.workflow }}` on behalf of @${{ github.actor }}." \
--body-file /tmp/pr_body.md \
--head $BRANCH \
--base 'release-ulmo' \
--reviewer 'edx/orbi-bom' \
Expand Down
Loading