-
Notifications
You must be signed in to change notification settings - Fork 9
46 lines (42 loc) · 1.77 KB
/
update_asf_tools_version.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
name: Update ASF Tools version
on:
workflow_dispatch:
inputs:
asf_tools_version:
description: 'The new version of ASF Tools'
required: true
jobs:
bump_sdk_version:
name: Bump the ASF Tools version
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.TOOLS_BOT_PAK }}
- name: create patch branch
id: patch
env:
ASF_TOOLS_VERSION: ${{ github.event.inputs.asf_tools_version }}
PATCH_BRANCH: bump-asf-tools-${{ github.event.inputs.asf_tools_version }}
run: |
git config user.name "tools-bot"
git config user.email "UAF-asf-apd@alaska.edu"
echo "::set-output name=branch::${PATCH_BRANCH}"
git checkout -b ${PATCH_BRANCH}
sed -i -r "s|asf-tools/v[0-9]+\.[0-9]+\.[0-9]+|asf-tools/${ASF_TOOLS_VERSION}|" docs/tools/asf_tools.md
sed -i -r "s|\`asf_tools\` \*v[0-9]+\.[0-9]+\.[0-9]+\*|\`asf_tools\` \*${ASF_TOOLS_VERSION}\*|" docs/tools/asf_tools_api.md
sed -i -r "s|asf_tools=[0-9]+\.[0-9]+\.[0-9]+|asf_tools=${ASF_TOOLS_VERSION#v}|" environment.yml
git commit -am "Bump ASF Tools version to ${ASF_TOOLS_VERSION}"
git push origin ${PATCH_BRANCH}
- name: open PR
env:
PR_TITLE: Update ASF Tools version to ${{ github.event.inputs.asf_tools_version }}
PR_BODY: PR created by a `workflow_dispatch` event
GH_TOKEN: ${{ secrets.TOOLS_BOT_PAK }}
run: |
gh pr create --title "${PR_TITLE}" \
--body "${PR_BODY}" \
--assignee ASFHyP3/tools \
--label tools-bot \
--head ${{ steps.patch.outputs.branch }} \
--base main