blob: dc1f9fb53ab05df0e10578f4621298d238bf4b25 [file]
name: Scheduled - Update CDDL
on:
schedule:
- cron: 20 0 * * *
workflow_dispatch:
permissions:
contents: read
jobs:
update:
name: Update CDDL Specs
uses: ./.github/workflows/bazel.yml
with:
name: Update CDDL Specs
run: ./go update_cddl
artifact-name: cddl-updates
create-pr:
name: Create Pull Request
if: github.event.repository.fork == false
runs-on: ubuntu-latest
needs: update
permissions:
contents: write
pull-requests: write
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Download patch
uses: actions/download-artifact@v8
with:
pattern: cddl-updates
merge-multiple: true
- name: Apply patch
id: apply
run: |
if [ -s changes.patch ]; then
git apply --index changes.patch
if git diff --cached --quiet -- common/bidi/schema.json; then
echo "Projected BiDi schema unchanged; not opening a PR"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
fi
rm -f changes.patch
- name: Create Pull Request
if: steps.apply.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.SELENIUM_CI_TOKEN }}
commit-message: "update cddl spec files"
author: Selenium CI Bot <selenium-ci@users.noreply.github.com>
base: trunk
title: "[build] Automated CDDL Spec Update"
body: |
This is an automated pull request to repin the CDDL grammars and definition
indexes from w3c/webref, plus the rendered WebDriver BiDi spec from
w3c/webdriver-bidi.
Auto-generated by the [update-cddl workflow](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
branch: automated-cddl-updates
labels: C-build
on-failure:
name: On CDDL Update Failure
runs-on: ubuntu-latest
needs: [update, create-pr]
if: failure() || cancelled()
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_ICON_EMOJI: ":rotating_light:"
SLACK_COLOR: failure
SLACK_CHANNEL: selenium-tlc
SLACK_USERNAME: GitHub Workflows
SLACK_TITLE: Needs Investigation
SLACK_MESSAGE: "Unable to create the daily CDDL Update PR"
MSG_MINIMAL: actions url
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}