Repository navigation
Expand file tree
/
Copy pathgithub-actions-cron-sync-fork-from-upstream.yml
More file actions
50 lines (41 loc) · 1.88 KB
/
Copy pathgithub-actions-cron-sync-fork-from-upstream.yml
File metadata and controls
50 lines (41 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Automatically sync branch from upstream.
on:
schedule:
- cron: "*/5 * * * *"
workflow_dispatch:
inputs:
force:
description: Use GitHub --force push.
default:
jobs:
Sync-Branch-From-Upstream:
name: Automatic sync 'master' from The-OpenROAD-Project/OpenROAD-flow-scripts
runs-on: ${{ vars.USE_SELF_HOSTED == 'true' && 'self-hosted-ubuntu-26.04' || 'ubuntu-26.04' }}
# Only allow one action to run at a time.
concurrency: sync-branch-from-upstream
# Action needs no permissions, as push is granted via adding a deploy key
# with write access to the $DEPLOY_KEY secret.
permissions:
contents: read
# Don't run on the upstream repository and only run on the right branch.
if: ${{ (github.repository != 'The-OpenROAD-Project/OpenROAD-flow-scripts') && endsWith(github.ref, '/master') }}
steps:
- uses: The-OpenROAD-Project/actions/upstream_sync@main
env:
HAS_DEPLOY_KEY: ${{ !!(secrets.DEPLOY_KEY) }}
if: ${{ env.HAS_DEPLOY_KEY == 'true' }}
with:
upstreamRepo: The-OpenROAD-Project/OpenROAD-flow-scripts
upstreamBranch: master
# To always overwrite master branch, set UPSTREAM_SYNC to the exact
# string 'always overwrite master branch'.
# You can also manually trigger a workflow dispatch with the force
# value equal to 'true'.
force: ${{ github.event.inputs.force || (secrets.UPSTREAM_SYNC == 'always overwrite master branch') }}
# Quarterly release tags are only created upstream (see
# github-actions-quarterly-tag.yml); mirror the exact tag object
# here instead of letting this repo mint its own, which is what
# caused tag drift (same commit, two different annotated tag
# objects, breaking plain `git fetch` between the two remotes).
syncTags: true
deployKey: ${{ secrets.DEPLOY_KEY }}