generated from canonical/template-operator
-
Notifications
You must be signed in to change notification settings - Fork 10
39 lines (32 loc) · 1 KB
/
clone-pr.yaml
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
name: Clone PR to test 24.04 base
on:
pull_request:
types:
- opened
- synchronize
jobs:
clone-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout PR code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
- name: Install tox
run: |
pipx install tox
- name: Run switch to 24.04
run: |
tox run -e switch-24.04
- name: Create and push to a new branch
run: |
NEW_BRANCH="24.04-cloned-${{ github.event.pull_request.number }}"
git checkout -b $NEW_BRANCH
git add .
git commit -m "switch to 24.04"
git push origin $NEW_BRANCH