diff options
author | ྅༻ Ǭɀħ ༄༆ཉ <ozh@ozh.org> | 2022-04-21 16:01:47 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-21 16:01:47 +0300 |
commit | ceee876a7cbff549462c8a6c6542401bcf151cfa (patch) | |
tree | 7e8a675997da2a7ccf7bb36dab6f1784f76a77fc | |
parent | 16f31e58870452fc2c88cc3bec01f31e76339da8 (diff) |
Update GeoIP with Github App (#3298)
* Update GeoIP with Github App
Source: https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens
Co-authored-by: Léo Colombaro <git@colombaro.fr>
-rw-r--r-- | .github/workflows/update-geoip.yml | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/.github/workflows/update-geoip.yml b/.github/workflows/update-geoip.yml index 86a997c7..fbae4ece 100644 --- a/.github/workflows/update-geoip.yml +++ b/.github/workflows/update-geoip.yml @@ -4,15 +4,7 @@ on: # Run every Monday at 13:37 schedule: - cron: '37 13 * * 1' - # Run on every push to `master` - push: - branches: [ master ] - # And whenever this workflow is updated or a PR attempts to update the GeoIP files. - pull_request: - paths: - - '.github/workflows/update-geoip.yml' - - 'includes/geo/*' - # And manually + # Run manually workflow_dispatch: # Cancels all previous workflow runs for the same branch that have not yet completed. @@ -22,16 +14,21 @@ concurrency: cancel-in-progress: true jobs: - certificate-check: + update-geoip: name: "Check for updated GeoIP DB" - # Don't run the cron job on forks. - if: ${{ github.event_name != 'schedule' || github.repository == 'YOURLS/YOURLS' }} runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 + - name: Generate token + uses: tibdex/github-app-token@v1 + id: generate-token + with: + app_id: ${{ secrets.BOT_APP_ID }} + private_key: ${{ secrets.BOT_PRIVATE_KEY }} + - name: Check if newer GeoIP DB env: MAXMIND_API_KEY: ${{ secrets.MAXMIND_API_KEY }} @@ -56,6 +53,7 @@ jobs: - name: Create pull request uses: peter-evans/create-pull-request@v4 with: + token: ${{ steps.generate-token.outputs.token }} base: master branch: auto-update-geoip commit-message: "Update GeoIP DB" @@ -64,7 +62,5 @@ jobs: Updated GeoIP database, last verified on ${{ steps.get-date.outputs.DATE }}. Source: https://www.maxmind.com/en/account/login - - @YOURLS/core please close and reopen this PR to trigger the unit tests and ensure the GeoIP tests pass. labels: | dependencies |