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

Failure in changelog validation, but only on master #78

Open
kkalinowski-reef opened this issue Nov 17, 2022 · 1 comment
Open

Failure in changelog validation, but only on master #78

kkalinowski-reef opened this issue Nov 17, 2022 · 1 comment
Assignees

Comments

@kkalinowski-reef
Copy link

Hello.

We're using this fine process to validate our changelog, and while it used to work perfectly, right after the latest patch (dependencies upgrade around a month ago) we have this issue that it still works on branches, but fails on master.

Action ran from the master:
https://github.com/Backblaze/B2_Command_Line_Tool/actions/runs/3482161729/jobs/5824160163

Action ran from the feature branch:
https://github.com/Backblaze/B2_Command_Line_Tool/actions/runs/3478066136/jobs/5814975047

If we use the older version of the library (say 1.8.0 2f5ee4e) we get the following traceback (again, on master only):

(node:2167) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'number' of undefined
[10](https://github.com/kkalinowski-reef/B2_Command_Line_Tool/actions/runs/3486941050/jobs/5833991021#step:8:11)
    at run (/home/runner/work/_actions/zattoo/changelog/2f5ee4e229269d2fe78f53c102fce1285065c6a4/dist/index.js:10378:53)
[11](https://github.com/kkalinowski-reef/B2_Command_Line_Tool/actions/runs/3486941050/jobs/5833991021#step:8:12)
    at Object.676 (/home/runner/work/_actions/zattoo/changelog/2f5ee4e229269d2fe78f53c102fce1285065c6a4/dist/index.js:10466:1)
[12](https://github.com/kkalinowski-reef/B2_Command_Line_Tool/actions/runs/3486941050/jobs/5833991021#step:8:13)
    at __webpack_require__ (/home/runner/work/_actions/zattoo/changelog/2f5ee4e229269d2fe78f53c102fce1285065c6a4/dist/index.js:24:31)
[13](https://github.com/kkalinowski-reef/B2_Command_Line_Tool/actions/runs/3486941050/jobs/5833991021#step:8:14)
    at startup (/home/runner/work/_actions/zattoo/changelog/2f5ee4e229269d2fe78f53c102fce1285065c6a4/dist/index.js:43:19)
[14](https://github.com/kkalinowski-reef/B2_Command_Line_Tool/actions/runs/3486941050/jobs/5833991021#step:8:15)
    at /home/runner/work/_actions/zattoo/changelog/2f5ee4e229269d2fe78f53c102fce1285065c6a4/dist/index.js:47:18
[15](https://github.com/kkalinowski-reef/B2_Command_Line_Tool/actions/runs/3486941050/jobs/5833991021#step:8:16)
    at Object.<anonymous> (/home/runner/work/_actions/zattoo/changelog/2f5ee4e229269d2fe78f53c102fce1285065c6a4/dist/index.js:50:10)
[16](https://github.com/kkalinowski-reef/B2_Command_Line_Tool/actions/runs/3486941050/jobs/5833991021#step:8:17)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
[17](https://github.com/kkalinowski-reef/B2_Command_Line_Tool/actions/runs/3486941050/jobs/5833991021#step:8:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
[18](https://github.com/kkalinowski-reef/B2_Command_Line_Tool/actions/runs/3486941050/jobs/5833991021#step:8:19)
    at Module.load (internal/modules/cjs/loader.js:863:32)
[19](https://github.com/kkalinowski-reef/B2_Command_Line_Tool/actions/runs/3486941050/jobs/5833991021#step:8:20)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
[20](https://github.com/kkalinowski-reef/B2_Command_Line_Tool/actions/runs/3486941050/jobs/5833991021#step:8:21)
(node:2167) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
[21](https://github.com/kkalinowski-reef/B2_Command_Line_Tool/actions/runs/3486941050/jobs/5833991021#step:8:22)
(node:2167) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

which would mean that the issue was there earlier as well, just went unnoticed.

What could we be missing? Is there any way to make it work properly on master?

@dobladov dobladov self-assigned this Nov 17, 2022
@dobladov
Copy link
Collaborator

dobladov commented Nov 17, 2022

After having a look, unfortunately as it is right now the action is designed to only work on pull requests, that's why it fails at that point on push to master.

I see here it gets executed also for push.
https://github.com/Backblaze/B2_Command_Line_Tool/blob/79620dc244ff63e368e11ff0eba2d79d6231143c/.github/workflows/ci.yml#L4-L5

I would recommend using the action as we do on a separated workflow for only pull requests.

name: Changelog

on:
  pull_request:
    types: [
        opened,
        ready_for_review,
        reopened,
        synchronize,
        labeled,
        unlabeled,
    ]
    branches:
      - hotfix
      - master
      - production
      - release

jobs:
  changelog:
    name: Changelog
    if: |
      github.event.pull_request.draft == false &&
      !contains(github.event.pull_request.labels.*.name, 'dependencies')
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: zattoo/changelog@v1
        with:
          token: ${{github.token}}

Likewise, I will consider adding support to just validate and not check for modified files when there's no pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants