update-conformance-yaml #17239
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: update-conformance-yaml | |
on: | |
workflow_dispatch: {} | |
schedule: | |
- cron: "0 */1 * * *" | |
push: | |
paths: | |
- hack/generate-conformanceyaml.sh | |
jobs: | |
update-conformance-yaml: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | |
- name: configure system | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
gh auth login --with-token < <(echo ${{ secrets.GITHUB_TOKEN }}) | |
gh auth status | |
- name: produce tag dump | |
run: | | |
./hack/generate-conformanceyaml.sh | |
- name: determine changes | |
id: determine-changes | |
run: | | |
if git ls-files --others --modified --deleted --exclude-standard | grep -E 'kodata/conformance-testdata/'; then | |
echo "changes=true" >> $GITHUB_OUTPUT | |
fi | |
- name: commit and push if there are changes | |
if: ${{ steps.determine-changes.outputs.changes == 'true' }} | |
run: | | |
TIMESTAMP="$(git log -n1 --pretty='format:%cd' --date=format:'%Y-%m-%d-%H-%M')" | |
NEW_BRANCH="conformance-yaml-update-for-${TIMESTAMP}" | |
git add ./kodata/conformance-testdata/ | |
git branch "${NEW_BRANCH}" | |
git checkout "${NEW_BRANCH}" | |
git commit -m "update conformance yaml for ${TIMESTAMP}" | |
git push -f origin "${NEW_BRANCH}" | |
gh pr create --title "Update conformance yaml ${TIMESTAMP}" --body "updates conformance yaml for ${TIMESTAMP}" | |
gh pr merge --merge --auto "${NEW_BRANCH}" |