This repository has been archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a22a28e
commit 4f94c5d
Showing
1 changed file
with
25 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,40 +5,46 @@ on: | |
- cron: "0 8 * * *" # Runs every day at 8 AM GMT | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
update_fork: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.BINARIES_RELEASE_PAT }} | ||
|
||
- name: Configure Git | ||
- name: Get current date | ||
id: current_date | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
echo "date=$(date +'%d%m%y')" >> $GITHUB_OUTPUT | ||
echo "time=$(date +'%d%m%y %H:%M')" >> $GITHUB_OUTPUT | ||
- name: Add upstream remote | ||
- name: Configure git | ||
env: | ||
GITHUB_USERNAME: ${{ github.repository_owner }} | ||
run: | | ||
git remote add upstream https://github.com/microsoft/vscode.git | ||
git config --global user.email "$( echo "${GITHUB_USERNAME}" | awk '{print tolower($0)}' )[email protected]" | ||
git config --global user.name "${GITHUB_USERNAME} CI" | ||
- name: Fetch upstream changes | ||
continue-on-error: true | ||
run: | | ||
git remote add upstream https://github.com/microsoft/vscode.git | ||
git fetch upstream | ||
- name: Merge upstream changes | ||
run: | | ||
git checkout -b update-from-upstream | ||
git merge upstream/main | ||
- name: Push changes to fork | ||
run: | | ||
git push -u origin update-from-upstream | ||
git merge upstream/main || true | ||
git add -A | ||
- name: Create pull request | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh pr create --base main --head update-from-upstream --title "Update from upstream" --body "This pull request updates the fork with the latest changes from the upstream repository." | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
token: ${{ secrets.BINARIES_RELEASE_PAT }} | ||
commit-message: Fetch upstream ${{ steps.current_date.outputs.time }} | ||
branch: fetch-upstream-${{ steps.current_date.outputs.date }} | ||
title: Fetch upstream ${{ steps.current_date.outputs.date }} |