-
Notifications
You must be signed in to change notification settings - Fork 6
43 lines (43 loc) · 1.46 KB
/
snapshot.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
name: snapshot
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
type: string
required: true
branch:
description: |
Branch to take the snapshot from. Use to update docs for the current release by
taking the state from a branch rather than a tag
type: string
required: false
jobs:
snapshot:
runs-on: ubuntu-latest
env:
VERSION: ${{inputs.version}}
PR_BRANCH: release-${{inputs.version}}
SOURCE_BRANCH: ${{inputs.branch || ''}}
steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v1
- name: Create snapshot
run: |
git config --global user.email "info@thin-edge.io"
git config --global user.name "Versioneer"
git checkout -b "$PR_BRANCH"
if [ -n "$SOURCE_BRANCH" ]; then
just checkout-version "$VERSION" "$SOURCE_BRANCH"
git add -A .
git commit -am "Backporting snapshot for version $VERSION on branch"
else
just checkout-version "$VERSION"
git add -A .
git commit -am "Create snapshot for version $VERSION"
fi
git push --set-upstream origin "$PR_BRANCH"
- name: create pull request
run: gh pr create -B main -H "$PR_BRANCH" --title "create snapshot for version $VERSION" --body "Release $VERSION"
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_PAT }}