Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/forward-integrate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Forward Integrate

on:
schedule:
- cron: '*/5 * * * *'

jobs:
merge-main:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v2
with:
ref: main
- name: Fetch upstream
run: git fetch upstream/main
- name: Merge upstream/main into main
id: merge
run: |
git merge upstream/main
if [ -z "$(git log origin/main..HEAD)" ]; then
echo "::set-output name=new-commits::false"
else
echo "::set-output name=new-commits::true"
fi
- name: Check for merge conflicts
if: steps.merge.outputs.new-commits == 'true'
run: |
if git diff --quiet; then
echo "No merge conflicts"
else
echo "Merge conflicts found"
git diff
exit 1
fi
- name: Create new branch and push changes
id: create-branch
if: steps.merge.outputs.new-commits == 'true'
run: |
BRANCH_NAME="forward-integration-$(date +%Y%m%d%H%M%S)"
git checkout -b $BRANCH_NAME
git push origin $BRANCH_NAME
echo "::set-output name=BRANCH_NAME::$BRANCH_NAME"
- name: Create pull request
if: steps.merge.outputs.new-commits == 'true'
uses: peter-evans/create-pull-request@v3

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Forward Integrate' step
Uses Step
uses 'peter-evans/create-pull-request' with ref 'v3', not a pinned commit hash
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Forward integration from upstream/main'
branch: ${{ steps.create-branch.outputs.BRANCH_NAME }}
base: main
title: 'Forward integration from upstream/main'
body: 'This is an automated pull request to integrate changes from upstream/main'
Comment on lines +9 to +53

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions Job or Workflow does not set permissions
Loading