-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
55 lines (51 loc) · 1.78 KB
/
pin-browsers.yml
File metadata and controls
55 lines (51 loc) · 1.78 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Pin Browsers
on:
schedule:
- cron: 10 0 * * *
workflow_dispatch:
permissions:
contents: read
jobs:
update:
name: Update Pinned Browsers
uses: ./.github/workflows/bazel.yml
with:
name: Pin Browsers
run: bazel run //scripts:pinned_browsers
artifact-name: pinned-browsers
push-changes:
name: Push Changes
needs: update
if: github.event.repository.fork == false
uses: ./.github/workflows/commit-changes.yml
with:
artifact-name: pinned-browsers
commit-message: "Update pinned browser versions"
push-branch: pinned-browser-updates
secrets:
SELENIUM_CI_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }}
create-pr:
name: Create Pull Request
needs: push-changes
if: github.event.repository.fork == false && needs.push-changes.outputs.changes-committed == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create Pull Request
env:
GH_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }}
run: |
existing=$(gh pr list --head pinned-browser-updates --json number --jq '.[0].number // empty')
if [ -n "$existing" ]; then
echo "::notice::PR #$existing already exists"
pr="$existing"
else
pr=$(gh pr create \
--head pinned-browser-updates \
--base trunk \
--title "[dotnet][rb][java][js][py] Automated Browser Version Update" \
--body $'This is an automated pull request to update pinned browsers and drivers\n\nMerge after verify the new browser versions properly passing the tests and no bugs need to be filed' \
--json number --jq '.number')
fi
gh pr merge "$pr" --auto --squash --delete-branch