Skip to content

Update auto-cl-update-atd.yml #8

Update auto-cl-update-atd.yml

Update auto-cl-update-atd.yml #8

name: Auto CL update
on:
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: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install requirements
run: pip install requests pyyaml
- name: Get PR Information
id: pr_info
run: |
PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
- name: Run post-merge script
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python Tools/ATD/auto_cl.py "${{ env.GITHUB_TOKEN }}" "${{ github.repository }}" "${{ env.PR_NUMBER }}"
- 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
run: |
git add .
git commit -m "Auto cl update" || echo "No changes to commit"
- name: Push changes to a new branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git branch update-changelog
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} update-changelog
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update-changelog
commit-message: "Auto cl update"
title: "Auto CL update"
body: "This PR updates the changelog."
labels: "auto-update, changelog"