-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
51 lines (48 loc) · 1.56 KB
/
action.yml
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
51
name: 'Update Staging Branch'
description: 'Update a staging branch onto main as part of Nightly CI'
branding:
icon: 'git-commit'
color: 'blue'
inputs:
user:
description: |
The name that will be associated with any created commits
type: string
required: true
email:
description: |
The email address that will be associated with any created commits
type: string
required: true
main-branch:
description: |
The name of the main branch.
type: string
default: 'main'
staging-branch:
description: |
The name of the branch containing accumulated patches that need to be
applied in order for the latest CIRCT to work with Chisel.
type: string
default: 'ci/ci-circt-nightly'
runs:
using: composite
steps:
- name: 'Checkout'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Rebase ${{ inputs.staging-branch }} onto ${{ inputs.main-branch }}'
if: github.event_name != 'pull_request'
shell: bash
run: |
# Rebase the staging branch on the default branch. Create the staging
# branch if it doesn't exist.
git checkout -b ${{ inputs.staging-branch }} ${{ inputs.main-branch }}
if [[ ! `git fetch origin ${{ inputs.staging-branch }}` ]]; then
git reset --hard origin/${{ inputs.staging-branch }}
git config user.name ${{ inputs.user }}
git config user.email ${{ inputs.email }}
git rebase origin/${{ inputs.main-branch }}
fi
git push --force origin ${{ inputs.staging-branch }}