forked from SeleniumHQ/selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (36 loc) · 1.27 KB
/
mirror-selenium-releases.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: mirror-selenium-releases
on:
schedule:
- cron: '0 */12 * * *'
workflow_dispatch:
jobs:
build:
if: github.repository_owner == 'seleniumhq'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Read api.github.com and filter response
run: |
cd common/mirror
export JQ_FILTER="[.[] | {tag_name: .tag_name, assets: [.assets[] | {browser_download_url: .browser_download_url} ] } ]"
curl -H "Authorization: ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/SeleniumHQ/selenium/releases | jq "$JQ_FILTER" > selenium
- name: Commit files
id: git
run: |
export CHANGES=$(git status -s)
if [ -n "$CHANGES" ]; then
git config --local user.email "selenium-ci@users.noreply.github.com"
git config --local user.name "Selenium CI Bot"
git add common/mirror/selenium
git commit -m "Update mirror info (`date`)" -a
echo "::set-output name=commit::true"
fi
- name: Push changes
if: steps.git.outputs.commit == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.SELENIUM_CI_TOKEN }}
branch: ${{ github.ref }}