Skip to content

Commit

Permalink
Update auto-cl-update-atd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
themanyfaceddemon authored Jun 27, 2024
1 parent 235efa1 commit c633c86
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/auto-cl-update-atd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ jobs:
- name: Checkout repository
uses: actions/[email protected]

- name: Pull latest changes for update-changelog branch
run: |
git fetch origin
git checkout -B update-changelog origin/update-changelog || git checkout -b update-changelog
git pull origin update-changelog --rebase
- name: Setup Python
uses: actions/setup-python@v3
with:
Expand All @@ -43,11 +49,9 @@ jobs:
git diff-index --quiet HEAD || git commit -m "Auto cl update"
continue-on-error: true

- name: Pull latest changes for update-changelog branch
- name: Merge changes with ours strategy
if: steps.commit-changes.outcome == 'success'
run: |
git fetch origin
git checkout -B update-changelog origin/update-changelog || git checkout -b update-changelog
git merge -X ours origin/update-changelog || echo "No changes to merge"
- name: Push changes to a new branch
Expand All @@ -61,17 +65,18 @@ jobs:
id: pr-check
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: pullRequests } = await github.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
head: `${context.repo.owner}:update-changelog`
});
return pullRequests.length > 0;
core.setOutput('pr_exists', pullRequests.length > 0 ? 'true' : 'false');
- name: Create Pull Request
if: steps.commit-changes.outcome == 'success' && steps.pr-check.outputs.result == 'false'
if: steps.commit-changes.outcome == 'success' && steps.pr-check.outputs.pr_exists == 'false'
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit c633c86

Please sign in to comment.