-
Notifications
You must be signed in to change notification settings - Fork 6
41 lines (41 loc) · 1.36 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
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:
release:
runs-on: ubuntu-latest
env:
VERSION: ${{inputs.version}}
PR_BRANCH: release-${{inputs.version}}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: extractions/setup-just@v1
- run: |
git config --global user.email "info@thin-edge.io"
git config --global user.name "Versioneer"
git checkout -b "$PR_BRANCH"
if [ -n "${{inputs.branch}}" ]; then
just checkout-version "$VERSION"
git commit -am "Create snapshot for version $VERSION"
else
just checkout-version "$VERSION" "${{inputs.branch}}"
git commit -am "Backporting snapshot for version $VERSION on branch"
fi
git push origin
- 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 }}