We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If labels like major, minor or patch should be added to a PR the workflow needs to be extended and use the outputs of this action.
major
minor
patch
But this should be implemented directly into the action as optional flag.
name: commit on: pull_request: push: branches: - main jobs: commit-message: name: conventional commits runs-on: [self-hosted, Linux] steps: - uses: actions/checkout@v2 - uses: taskmedia/action-conventional-commits@v1.0.1 id: cc with: types: "fix|feat|revert|chore|docs" - name: label PR with version type if: | github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.user.login != 'dependabot[bot]' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_NUMBER: ${{ github.event.number }} REPO: ${{ github.repository }} shell: bash run: | echo $GITHUB_TOKEN | gh auth login --with-token LABELS=$(gh pr view $PR_NUMBER --repo $REPO --json "labels" --jq '.labels[].name') # add version_type label if not already present if [[ "$LABELS" != *"${{ steps.cc.outputs.version_type }}"* ]]; then echo "add label ${{ steps.cc.outputs.version_type }} to PR $PR_NUMBER" gh pr edit $PR_NUMBER \ --add-label "${{ steps.cc.outputs.version_type }}" \ --repo $REPO else echo "label ${{ steps.cc.outputs.version_type }} already present at PR $PR_NUMBER" fi # remove old SemVer labels if present while read -r label do if [ "$label" = "patch" ] && [ "$label" != "${{ steps.cc.outputs.version_type }}" ]; then echo "removing label patch from PR $PR_NUMBER" gh pr edit $PR_NUMBER --repo $REPO --remove-label "patch" continue fi if [ "$label" = "minor" ] && [ "$label" != "${{ steps.cc.outputs.version_type }}" ]; then echo "removing label minor from PR $PR_NUMBER" gh pr edit $PR_NUMBER --repo $REPO --remove-label "minor" continue fi if [ "$label" = "major" ] && [ "$label" != "${{ steps.cc.outputs.version_type }}" ]; then echo "removing label major from PR $PR_NUMBER" gh pr edit $PR_NUMBER --repo $REPO --remove-label "major" continue fi done <<< "$LABELS"
The text was updated successfully, but these errors were encountered:
fty4
Successfully merging a pull request may close this issue.
If labels like
major
,minor
orpatch
should be added to a PR the workflow needs to be extended and use the outputs of this action.But this should be implemented directly into the action as optional flag.
example
The text was updated successfully, but these errors were encountered: