Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Add PREVIOUS_REVISION to environment #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
woile merged 1 commit into commitizen-tools:master from janw:add-previous-rev-to-env
Mar 5, 2024
Merged

feat: Add PREVIOUS_REVISION to environment #79

woile merged 1 commit into commitizen-tools:master from janw:add-previous-rev-to-env
Mar 5, 2024

Conversation

Copy link
Contributor

@janw janw commented Jan 26, 2024

This adds the PREVIOUS_REVISION environment variable, allowing subsequent workflow steps to detect if the revision was changed by commitizen.

Example workflow
name: Bump version
on:
 push:
 branches:
 - main
jobs:
 bump-version:
 if: "!startsWith(github.event.head_commit.message, 'bump:')"
 runs-on: ubuntu-latest
 environment: release
 steps:
 - name: Check out
 uses: actions/checkout@v3
 with:
 token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
 fetch-depth: 0
 - name: Import GPG key
 uses: crazy-max/ghaction-import-gpg@v6
 with:
 gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
 passphrase: ${{ secrets.GPG_PASSPHRASE }}
 - name: Create bump and changelog
 uses: commitizen-tools/commitizen-action@master
 with:
 dry_run: true
 github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
 changelog_increment_filename: body.md
 - name: Verify commit signature
 if: env.REVISION != env.PREVIOUS_REVISION
 run: git verify-commit HEAD
 - name: Create GitHub release
 if: env.REVISION != env.PREVIOUS_REVISION
 uses: ncipollo/release-action@v1
 with:
 tag: v${{ env.REVISION }}
 bodyFile: "body.md"
 skipIfReleaseExists: true

Copy link
Member

@noirbizarre noirbizarre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was missing this one too 👌🏼

@woile woile merged commit 5329248 into commitizen-tools:master Mar 5, 2024
@janw janw deleted the add-previous-rev-to-env branch March 7, 2024 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@woile woile woile approved these changes

+1 more reviewer

@noirbizarre noirbizarre noirbizarre approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /