Skip to content

snapshot

snapshot #10

Workflow file for this run

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 }}