-
Notifications
You must be signed in to change notification settings - Fork 40
84 lines (67 loc) · 2.33 KB
/
update-maghemite.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Update maghemite
on:
workflow_dispatch:
inputs:
reflector_access_token:
description: Access token for use in authenticating as the Reflector bot
type: string
reflector_user_id:
description: User id of the Reflector bot
type: string
permissions:
contents: write
pull-requests: write
# This is a workaround for the GitHub cli requiring excessive permissions when updating a pull
# request (https://github.com/cli/cli/discussions/5307)
repository-projects: read
jobs:
generate-update:
concurrency:
group: maghemite-integration
cancel-in-progress: true
runs-on: ubuntu-22.04
env:
INT_BRANCH: maghemite-integration
TARGET_BRANCH: main
steps:
# Checkout both the target and integration branches
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
token: ${{ inputs.reflector_access_token }}
fetch-depth: 0
- name: Update from main
run: |
. ./tools/reflector/helpers.sh
PATHS=("tools")
merge $TARGET_BRANCH $INT_BRANCH ${{ inputs.reflector_user_id }} $PATHS
- name: Update maghemite versions
run: |
./tools/update_maghemite.sh
- name: Extract new maghemite package version
run: |
eval $(cat tools/maghemite_openapi_version | grep COMMIT)
echo "version=${COMMIT:0:7}" >> $GITHUB_OUTPUT
id: updated
- name: Commit changes
run: |
. ./tools/reflector/helpers.sh
PATHS=("tools/maghemite_openapi_version")
CHANGES=()
commit $TARGET_BRANCH $INT_BRANCH ${{ inputs.reflector_user_id }} PATHS CHANGES
echo "api=${CHANGES[0]}" >> $GITHUB_OUTPUT
id: committed
- name: Update pull request
env:
GH_TOKEN: ${{ inputs.reflector_access_token }}
run: |
. ./tools/reflector/helpers.sh
TITLE=""
echo "" > body
if [ ${{ steps.committed.outputs.api }} ]
then
TITLE+=" maghemite to ${{ steps.updated.outputs.version }}"
echo "Updated maghemite to commit ${{ steps.updated.outputs.version }}." >> body
echo "" >> body
fi
TITLE="Update${TITLE}"
update_pr $TARGET_BRANCH $INT_BRANCH "$TITLE" "body"