Skip to content
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

[Feature Request]: Add Changelog Workflow and Documentation ✨ #971

Closed
1 task done
Nishitbaria opened this issue Aug 7, 2023 · 3 comments
Closed
1 task done
Assignees
Labels
enhancement New feature or request gssoc23 GirlScript summer of code level1 easy

Comments

@Nishitbaria
Copy link
Contributor

Nishitbaria commented Aug 7, 2023

Description

We want to add a new GitHub workflow called "Changelog" to our repository. This workflow will automate the generation of a conventional changelog based on the commits in the repository. The generated changelog will be used to create a release in GitHub.

Workflow: Changelog

name: Changelog
on:
  push:
    branches:
      - main

jobs:
  changelog:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Conventional Changelog Action
        id: changelog
        uses: TriPSs/conventional-changelog-action@v3
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          output-file: "false"

      - name: Create Release
        uses: actions/create-release@v1
        if: ${{ steps.changelog.outputs.skipped == 'false' }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ steps.changelog.outputs.tag }}
          release_name: ${{ steps.changelog.outputs.tag }}
          body: ${{ steps.changelog.outputs.clean_changelog }}

Describe breifly how would you implement the same.

Solution_steps

How It Works

The "Changelog" workflow is triggered on every push to the "main" branch. It consists of two main steps:

  1. Conventional Changelog Action: This step uses the TriPSs/conventional-changelog-action@v3 action to generate a conventional changelog based on the commit messages in the repository. The github-token input is required to authenticate with GitHub API and access the commit data.

  2. Create Release: This step uses the actions/create-release@v1 action to create a GitHub release if the changelog was not skipped. The if condition checks whether the changelog generation was successful (skipped == 'false'). If the changelog was generated successfully, a release will be created with the tag name and release name set to the generated tag, and the body of the release will be set to the clean changelog.

How to Implement the Workflow

To implement the "Changelog" workflow in your repository, follow these steps:

  1. Open your repository in GitHub.

  2. Click on the "Actions" tab.

  3. Click on the "New workflow" button.

  4. Choose "Set up a workflow yourself."

  5. Replace the content of the new YAML file with the provided "Changelog" workflow content.

  6. Click on the "Start commit" button and commit the new workflow file to the "main" branch.

  7. The "Changelog" workflow is now added to your repository, and it will automatically run on every push to the "main" branch.

Additional Notes

Make sure you have the necessary permissions to create releases and access secrets like secrets.GITHUB_TOKEN in your repository. The workflow will use the GITHUB_TOKEN to authenticate with GitHub and perform release-related actions.

Are you contributing for a program?

GSSoC23

Code of Conduct

@Nishitbaria Nishitbaria added the enhancement New feature or request label Aug 7, 2023
@Nishitbaria
Copy link
Contributor Author

Hey @panwar8279 Please assign me this issue ✨

@panwar8279 panwar8279 added gssoc23 GirlScript summer of code level1 easy labels Aug 8, 2023
@panwar8279
Copy link
Collaborator

Hi @Nishitbaria , I have assigned this task to you. Kindly complete this within 2 days. Good luck!

@github-actions
Copy link

👋 @Nishitbaria This issue is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gssoc23 GirlScript summer of code level1 easy
Projects
None yet
Development

No branches or pull requests

2 participants