snapshot #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- 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 "${{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 --set-upstream origin release-1.0.0 | |
- 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 }} |