Skip to content

Commit 57a4060

Browse files
authored
[CI] Mirror api.github.com using scheduled job (#11711)
* [CI] Mirror api.github.com using scheduled job (part of #11672) * [CI] Rename scheduled job for mirroring GH API responses * [CI] Include manual trigger for mirror job * [CI] Use GitHub bot for pushing changes in scheduled job
1 parent 1c70137 commit 57a4060

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: mirror
2+
3+
on:
4+
schedule:
5+
- cron: '0 */12 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
persist-credentials: false
15+
fetch-depth: 0
16+
- name: Read api.github.com and filter response
17+
run: |
18+
cd common/mirror
19+
export JQ_FILTER="[.[] | {tag_name: .tag_name, assets: [.assets[] | {browser_download_url: .browser_download_url} ] } ]"
20+
curl -H "Authorization: ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/SeleniumHQ/selenium/releases | jq "$JQ_FILTER" > selenium
21+
- name: Commit files
22+
id: git
23+
run: |
24+
export CHANGES=$(git status -s)
25+
if [ -n "$CHANGES" ]; then
26+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
27+
git config --local user.name "github-actions[bot]"
28+
git add common/mirror/selenium
29+
git commit -m "Update mirror info" -a
30+
echo "::set-output name=commit::true"
31+
fi
32+
- name: Push changes
33+
if: steps.git.outputs.commit == 'true'
34+
uses: ad-m/github-push-action@master
35+
with:
36+
github_token: ${{ secrets.GITHUB_TOKEN }}
37+
branch: ${{ github.ref }}

common/mirror/selenium

Whitespace-only changes.

0 commit comments

Comments
 (0)