Open veds12 opened 3 years ago
Thank you @veds12, I will test it ASAP!
@ManosMagnus I have made the required changes. Let me know if anything else needs to be changed
Hi @ManosMagnus. Does anything else need to be changed?
@ManosMagnus I think now it should work. I forgot to add one line. If you test it on your fork as it is however, you will get this error:
git config --local user.email
git config --local user.name
git add CHANGELOG.md && git commit -m 'Updated CHANGELOG.md' && echo ::set-env name=push::1 || echo "No changes to CHANGELOG.md"
shell: /usr/bin/bash -e {0}
env:
CI_USER:
CI_EMAIL:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
Error: Process completed with exit code 1.
This is because the changelog uses encrypted secrets of the aidudezzz organisation (secrets.AIDUDEZZZ_BOT_TOKEN
, etc.) whereas to run it on your fork, it needs encrypted secrets of your account. If you want to run it properly on your fork, you'll have to use this after changing the branch name, that you are targeting the PR to and the user name and email to replace mine at relevant places:
name: Generate Changelog
on:
push:
branches:
- test_workflow
jobs:
generate_changelog:
name: Update Changelog
runs-on: ubuntu-latest
steps:
- name: Checkout test_workflow
uses: actions/checkout@v2
- name: Generate changelog
uses: charmixer/auto-changelog-action@v1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Commit files
env:
CI_USER: ${{ secrets.YOUR_GITHUB_USER }}
CI_EMAIL: ${{ secrets.YOUR_GITHUB_EMAIL }}
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
git config --local user.email "vedantshah2012@gmail.com"
git config --local user.name "veds12"
git add CHANGELOG.md && git commit -m 'Updated CHANGELOG.md' && echo ::set-env name=push::1 || echo "No changes to CHANGELOG.md"
- name: Push changes
if: env.push == 1
env:
CI_USER: ${{ secrets.YOUR_GITHUB_USER }}
CI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push "https://$CI_USER:$CI_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:test_workflow
Please take a look and lmk if the changelog is generated as expected.
According to github blog, set-env
result in environment variables being introduced or modified without the intention of the workflow author. [...] We are monitoring telemetry for the usage of these commands and plan to fully disable them in the future.
I feel that is better go with the standard way
https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
This doesn't work for me (https://github.com/ManosMagnus/deepbots/runs/3229287857?check_suite_focus=true). Please try different push action like the following https://github.com/ManosMagnus/deepbots/blob/5c1c8fa6bf001594c2d98aebf2f357ec4398fbc9/.github/workflows/update_changelog.yml#L46-L51
@ManosMagnus can you provide a snippet of the error you get? It was working fine for me. Not sure what the problem is.
@veds12 Thank you for this excellent PR. @tsampazk @eakirtas I have tested it, and it works well.
Have you already set AIDUDEZZ_BOT_TOKEN
, AIDUDEZZZ_BOT_EMAIL
, and AIDUDEZZZ_BOT_USER
?
Note that it runs this workflow every time we push to the dev branch.
Note that it runs this workflow every time we push to the dev branch.
I replace dev
with master
, so it runs this workflow only when we merge dev
into master
.
Hi @KelvinYang0320. Sorry for the late reply.
Yes, I have used the AIDUDEZZ_BOT_TOKEN
, AIDUDEZZ_BOT_USER
and AIDUDEZZ_BOT_EMAIL
in the lines 18, 22 and 23:
https://github.com/veds12/deepbots/blob/b2b6076a5302430fba07cf7c8142f97b042e7d3a/.github/workflows/changelog_update.yml#L18
@tsampazk @eakirtas I have replaced master
with main
.
Closes #41
I know the issue mentions adding changelog to the readme but I was a bit confused about this since Changelogs are generally implemented in self-contained files. Do you need all the changes recorded in the README? (Might become a bit messy though)
Will be happy to make any changes if needed :)