Repo Sync #167
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: Repo Sync | |
on: | |
schedule: | |
- cron: "*/15 * * * *" | |
jobs: | |
repo-sync: | |
name: Repo Sync | |
runs-on: ubuntu-latest | |
steps: | |
- name: Extract local & upstream repository name (eosc-synergy) | |
if: contains(github.repository, 'eosc-synergy') | |
run: | | |
echo "REPO_NAME_LOCAL=https://github.com/eosc-synergy/FAIR_eva" >> "$GITHUB_ENV" | |
echo "REPO_NAME_UPSTREAM=https://github.com/IFCA-Advanced-Computing/FAIR_eva" >> "$GITHUB_ENV" | |
- name: Extract local & upstream repository name (IFCA-Advanced-Computing) | |
if: contains(github.repository, 'IFCA-Advanced-Computing') | |
run: | | |
echo "REPO_NAME_LOCAL=https://github.com/eosc-synergy/FAIR_eva" >> "$GITHUB_ENV" | |
echo "REPO_NAME_UPSTREAM=https://github.com/IFCA-Advanced-Computing/FAIR_eva" >> "$GITHUB_ENV" | |
- name: Print local & upstream repository variables | |
run: | | |
echo "Using local repository: $REPO_NAME_LOCAL" | |
echo "Using upstream repository: $REPO_NAME_UPSTREAM" | |
- name: Checkout <main> branch | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- uses: repo-sync/github-sync@v2 | |
name: Sync repo to branch <repo-sync> | |
with: | |
source_repo: $REPO_NAME_UPSTREAM | |
source_branch: main | |
destination_branch: repo-sync | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- run: bash -x ./.github/workflows/scripts/set_refs.sh $REPO_NAME_LOCAL | |
- run: git status | |
- uses: peter-evans/create-pull-request@v5 | |
name: Create/update pull request | |
with: | |
base: main | |
branch: repo-sync | |
title: Update references on repo-sync branch |