-
Notifications
You must be signed in to change notification settings - Fork 339
62 lines (53 loc) · 2.13 KB
/
Copy pathupdate-e2e-rancher-version.yml
File metadata and controls
62 lines (53 loc) · 2.13 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
51
52
53
54
55
56
57
58
59
60
61
62
name: Update e2e Rancher Version
on:
push:
branches:
- 'release-*'
jobs:
update-e2e-version:
permissions:
pull-requests: write
contents: write
actions: write
id-token: write
runs-on: ubuntu-latest
if: github.event.created && startsWith(github.ref, 'refs/heads/release-')
steps:
- name: Read secrets
uses: rancher-eio/read-vault-secrets@0da85151ad1f19ed7986c41587e45aac1ace74b6 # v3
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/github/app-credentials appId | APPID;
secret/data/github/repo/${{ github.repository }}/github/app-credentials privateKey | PRIVATEKEY
- name: Generate Token
id: generate-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ env.APPID }}
private-key: ${{ env.PRIVATEKEY }}
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Run update script
run: ./scripts/update-e2e-rancher-version.sh
shell: bash
- name: Create Pull Request
env:
APP_TOKEN: ${{ steps.generate-token.outputs.token }}
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
BRANCH_NAME="${{ github.ref_name }}"
NEW_BRANCH="update-e2e-test-version-${BRANCH_NAME}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
git checkout -b $NEW_BRANCH
git add .
git commit -m "Update e2e test version for ${BRANCH_NAME}"
git push -u origin $NEW_BRANCH
gh pr create \
--base "${BRANCH_NAME}" \
--head "$NEW_BRANCH" \
--title "Update e2e test version for ${BRANCH_NAME}" \
--body "This is an automated request to update e2e test versions in the release branch by @${GITHUB_ACTOR}."