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

Update the changelog generation workflow #266

Merged
merged 1 commit into from
Sep 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,41 @@ jobs:
- run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
- run: python3 -m pip install --user --requirement=ci/requirements.txt

- name: Get Date
id: get-date
run: |
echo "::set-output name=date::$(/bin/date -u "+%Y%m%d%H%M%S")"
- uses: actions/cache@v3
with:
path: |
.github/changelog-generator-cache
key: changelog-${{ steps.get-date.outputs.date }}
restore-keys: |
changelog-

- name: Get config
id: config
run: echo ::set-output name=config::$(python -c 'print(__import__("json").dumps(__import__("yaml").load(open(".github/changelog-config.yaml"))))')

- name: Generate changelog
id: changelog
uses: heinrichreimer/github-changelog-generator-action@v2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
configureSections: ${{ steps.config.outputs.config }}
cacheFile: github-changelog-generator-action.cache
cacheFile: .github/changelog-generator-cache
unreleased: false

- run: c2cciutils-checks --fix --check=prettier
- run: git add CHANGELOG.md
- run: git config --global user.email "ci@example.com"
- run: git config --global user.name "CI"
- run: git commit -m "Update the changelog"
- run: git checkout -b changelog-update
- run: git push origin changelog-update -f
- run: gh pr create --base=master --fill --label=chore || true
- id: status
run: echo ::set-output name=status::$(git status --short)
- run: |
c2cciutils-checks --fix --check=prettier
git add CHANGELOG.md
git config --global user.email "ci@example.com"
git config --global user.name "CI"
git commit -m "Update the changelog"
git checkout -b changelog-update
git push origin changelog-update -f
gh pr create --base=master --fill --label=chore || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: steps.status.outputs.status != ''