Auto CL update #5886
This file contains 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: Auto CL update | |
on: | |
schedule: | |
- cron: '10 * * * *' | |
- cron: '20 * * * *' | |
- cron: '30 * * * *' | |
- cron: '40 * * * *' | |
- cron: '50 * * * *' | |
- cron: '59 * * * *' | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
post_merge_job: | |
name: Auto CL update | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
- name: Pull latest changes for update-changelog branch | |
run: | | |
git fetch origin | |
git checkout -b update-changelog || git checkout update-changelog | |
- name: Setup Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install requirements | |
run: pip install aiohttp pyyaml | |
- name: Run post-merge script | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: python Tools/ADT/auto_cl.py "${{ secrets.PAT_CL_TOKEN }}" "${{ github.repository }}" | |
- name: Configure Git | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Commit changes | |
id: commit-changes | |
run: | | |
git add . | |
git diff-index --quiet HEAD || git commit -m "Auto cl update" | |
continue-on-error: true | |
- name: Push changes to a new branch | |
if: steps.commit-changes.outcome == 'success' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} update-changelog --force | |
- name: Create Pull Request | |
if: steps.commit-changes.outcome == 'success' | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
base: master | |
branch: update-changelog | |
commit-message: "Auto cl update" | |
title: "Auto CL update" | |
body: "No cl, no fun" | |
labels: "auto-update changelog" | |
continue-on-error: true |